How to specify custom CUDA compiler for CMake?

自闭症网瘾萝莉.ら 提交于 2020-08-10 18:55:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!