Skip to content

CUDA build fails to find CUDA #4651

@tomdeakin

Description

@tomdeakin

Building with the CUDA PI is still very challenging.

I have gcc 8.1, cuda10.2, cmake 3.18.3.

$ CUDA_BIN_PATH=/cm/shared/apps/cuda10.2/toolkit/10.2.89 CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/configure.py --cuda
$ CUDA_BIN_PATH=/cm/shared/apps/cuda10.2/toolkit/10.2.89 CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/compile.py
ninja: error: 'CUDA_CUDA_LIBRARY-NOTFOUND', needed by 'lib/libpi_cuda.so', missing and no known rule to make it

Looking in llvm/build/CMakeCache.txt, I see:

CUDA_CUDA_LIBRARY:FILEPATH=CUDA_CUDA_LIBRARY-NOTFOUND

but I also see all the other CUDA variables defined correctly.

I tried setting it manually on configure, but this gets the same error.

$ CUDA_BIN_PATH=/cm/shared/apps/cuda10.2/toolkit/10.2.89 CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/configure.py --cuda  --cmake-opt="-DCUDA_CUDA_LIBRARY=/cm/shared/apps/cuda10.2/toolkit/10.2.89/lib64/stubs/libcuda.so" 

If I also set CUDA_TOOLKIT_ROOT_DIR, then I get nonsense errors:

$CUDA_BIN_PATH=/cm/shared/apps/cuda10.2/toolkit/10.2.89 CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/configure.py --cuda  --cmake-opt="-DCUDA_TOOLKIT_ROOT_DIR=/cm/shared/apps/cuda10.2/toolkit/10.2.89 -DCUDA_CUDA_LIBRARY=/cm/shared/apps/cuda10.2/toolkit/10.2.89/lib64/stubs/libcuda.so"
[...]
-- Including the PI API CUDA backend.
CMake Error at /lustre/projects/bristol/modules/cmake/3.18.3/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found suitable version
  "10.2", minimum required is "10.1")

What do I need to pass to CMake to guarantee it finds the toolkit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcudaCUDA back-end

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions