Skip to content

Compiling DPC++ for CUDA error  #14222

Closed
Closed
@ranaelnaggar00

Description

@ranaelnaggar00

Describe the bug

I am trying to build DPC++ toolchain with support for Nvidea Cuda. I follow the steps here:
https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md

When I run the following command :

CUDA_LIB_PATH=/usr/local/cuda-12.5/lib64/stubs/ CC=gcc CXX=g++ python3 /sycl_workspace/llvm/buildbot/configure.py --cuda --cmake-opt="
-DCUDA_CUPTI_INCLUDE_DIR=
/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/include -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.5/ -DCUDA_INCLUDE_DIRS=/usr/local/cuda-12.5/include -DCUDA_CUDART_LIBRARY=/usr/local/cuda-12.5/lib64/libcudart.so"

I get this error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
~/sycl_workspace/llvm/sycl/plugins/cuda/CUDA_CUPTI_INCLUDE_DIR
used as include directory in directory ~/sycl_workspace/llvm/sycl/plugins/cuda
~/sycl_workspace/llvm/sycl/tools/sycl-trace/CUDA_CUPTI_INCLUDE_DIR
used as include directory in directory ~/sycl_workspace/llvm/sycl/tools/sycl-trace
CUDA_cupti_LIBRARY (ADVANCED)
linked by target "pi_cuda" in directory ~/sycl_workspace/llvm/sycl/plugins/cuda
linked by target "cuda_trace_collector" in directory ~/sycl_workspace/llvm/sycl/tools/sycl-trace

-- Generating done (5.1s)
CMake Generate step failed. Build files cannot be regenerated correctly.
There is CMakeCache.txt at ~/sycl_workspace/llvm/build/CMakeCache.txt ... you can try to remove it and rerun.

I have set up these variables as follows:
#export PATH=/usr/local/cuda-12.5/bin:$PATH
export PATH=/sycl_workspace/cmake-3.30.0-rc3-linux-x86_64/bin:$PATH
#export LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda-12.5
export CUDA_INCLUDE_DIRS="$CUDA_HOME/include"
export CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.5
export CUDA_CUDART_LIBRARY=/usr/local/cuda-12.5/lib64/libcudart.so.12
#export CUDA_CUPTI_INCLUDE_DIR=
/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/include
#export CUDA_CUPTI_INCLUDE_DIR=/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/include
export CUDA_CUPTI_LIBRARY=
/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/lib

#export CUDA_cupti_INCLUDE_DIR=~/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/include

export CUDA_cupti_LIBRARY=/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/lib
export CUDAToolkit_CUPTI_INCLUDE_DIR=
/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/include
export CUDAToolkit_cupti_LIBRARY=~/.local/lib/python3.8/site-packages/nvidia/cuda_cupti/lib
~

Would it be possible to help me solve this issue ?

To reproduce

cmake version 3.30.0-rc3

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Apr_17_19:19:55_PDT_2024
Cuda compilation tools, release 12.5, V12.5.40
Build cuda_12.5.r12.5/compiler.34177558_0

Environment

Linux 5.4.0-186-generic #206-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ninja --version
1.10.0

Additional context

No response

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