问题
I am working to install xgboost on Ubuntu 20.04. I want to force CMake to use a specific CUDA installation (11.0) instead of the default one (10.1). However, the compiler repeatedly throws the error as follows:
bill@magicMaker:~/xgboost/build$ cmake .. -DUSE_CUDA=ON -DR_LIB=ON
.
.
.
The CUDA compiler
"/usr/bin/nvcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/bill/xgboost/build/CMakeFiles/CMakeTmp
Some of the attempted fixes included:
cmake .. -DUSE_CUDA=ON -DR_LIB=ON -DCUDAToolkit_ROOT=/usr/local/cuda-11.0/
cmake .. -DUSE_CUDA=ON -DR_LIB=ON -DCUDAToolkit_ROOT=/usr/local/cuda-11.0/bin
sudo mv /usr/bin/nvcc /usr/bin/nvcc_old
export CUDACXX=/usr/local/cuda-11.0/bin/nvcc
export CUDACXX=nvcc
export CUDACXX=/usr/local/cuda-11.0/bin
sudo ln -s -T /usr/local/cuda-11.0/bin/nvcc /usr/bin/nvcc
Per Robert Crovella (who has been immensely helpful), "It would be necessary to find out how to get CMAKE 3.16 to use your desired nvcc install."
I'm new at Ubuntu (about three days now) and any detailed help would be appreciated. Thank you.
Previous question here.
来源:https://stackoverflow.com/questions/62925764/installing-xgboost-on-gpu-in-ubuntu-20-04-the-cuda-compiler-usr-bin-nvcc-is