[Openmp-commits] [PATCH] D106627: [OpenMP] Add environment variables to change stack / heap size in the CUDA plugin
Abhinav Gaba via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jul 22 21:32:53 PDT 2021
abhinavgaba added inline comments.
================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:652
+ } else {
+ if (cuCtxGetLimit(&StackLimit, CU_LIMIT_STACK_SIZE) != CUDA_SUCCESS)
+ return OFFLOAD_FAIL;
----------------
jdoerfert wrote:
> abhinavgaba wrote:
> > These enums don't seem to be defined in `cuda.h`, or somewhere else. Can you please take a look?
> My cuda.h defines them.
> ```
> /opt/cuda/targets/x86_64-linux/include/cuda.h
> 1130: CU_LIMIT_STACK_SIZE = 0x00, /**< GPU thread stack size */
> ```
> https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TYPES.html lists them as well.
> Are you sure they are not there?
I meant in the compiler sources. The other enums used in libomptarget seem to be defined in `openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h`. Absence of these definitions on a machine that doesn't have Cuda drivers installed, is causing a build fail for me with these errors:
```
llvm/openmp/libomptarget/plugins/cuda/src/rtl.cpp: In member function ‘int {anonymous}::DeviceRTLTy::initDevice(int)’:
llvm/openmp/libomptarget/plugins/cuda/src/rtl.cpp:649:25: error: ‘CU_LIMIT_STACK_SIZE’ was not declared in this scope
if (cuCtxSetLimit(CU_LIMIT_STACK_SIZE, StackLimit) != CUDA_SUCCESS)
^~~~~~~~~~~~~~~~~~~
```
I looked at the buildbots, but they are skipping building the cuda plugin altogether, so don't report any fails. For instance, https://lab.llvm.org/buildbot/#/builders/84/builds/12107/steps/4/logs/stdio has this in the log:
```
-- Could NOT find LIBOMPTARGET_DEP_CUDA_DRIVER (missing: LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES)
-- Could NOT find LIBOMPTARGET_DEP_VEO (missing: LIBOMPTARGET_DEP_VEO_LIBRARIES LIBOMPTARGET_DEP_VEOSINFO_LIBRARIES LIBOMPTARGET_DEP_VEO_INCLUDE_DIRS)
-- LIBOMPTARGET: Building offloading runtime library libomptarget.
...
-- LIBOMPTARGET: Not building CUDA offloading plugin: libelf dependency not found.
...
-- check-libomptarget does nothing.
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106627/new/
https://reviews.llvm.org/D106627
More information about the Openmp-commits
mailing list