Skip to content

Commit b3977b5

Browse files
authored
[SYCL][Doc] Describe DPC++ CUDA install w/ non-standard toolkit loc (#4663)
1 parent 5667aba commit b3977b5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

sycl/doc/GetStartedGuide.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,24 @@ a Titan RTX GPU (SM 71), but it should work on any GPU compatible with SM 50 or
161161
above. The default SM for the NVIDIA CUDA backend is 5.0. Users can specify
162162
lower values, but some features may not be supported.
163163

164+
**Non-standard CUDA location**
165+
166+
If the CUDA toolkit is installed in a non-default location on your system, two considerations must be made.
167+
168+
Firstly, **do not** add the toolkit to your standard environment variables (`PATH`, `LD_LIBRARY_PATH`), as to do so will create conflicts with OpenCL headers.
169+
170+
Secondly, set the `CUDA_LIB_PATH` environment variable and pass the CMake variable `CUDA_TOOLKIT_ROOT_DIR` as follows:
171+
172+
```
173+
CUDA_LIB_PATH=/path/to/cuda/toolkit/lib64/stubs CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/configure.py --cuda --cmake-opt="-DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda/toolkit"
174+
175+
CUDA_LIB_PATH=/path/to/cuda/toolkit/lib64/stubs CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/compile.py
176+
177+
$DPCPP_HOME/llvm/build/bin/clang++ -std=c++17 -O3 -fsycl -fsycl-targets=nvptx64-nvidia-cuda --cuda-path=/path/to/cuda/toolkit *.cpp -o a.out
178+
179+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DPCPP_HOME/llvm/build/lib ./a.out
180+
```
181+
164182
### Build DPC++ toolchain with support for HIP AMD
165183

166184
There is experimental support for DPC++ for HIP devices.

0 commit comments

Comments
 (0)