-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No CMAKE_CUDA_COMPILER could be found (solved) #13
Comments
Its still got some error:
|
Linking CXX shared library ../../../lib.linux-x86_64-3.6 |
Sorry, this is an issue referenced to here, it's an issue about @travller59's library |
@jinfagang are you able to solve the problem? I am also facing the same error |
Is the problem solved? I am also facing the same problem on Jetson TX2. |
Add these line to your ~/.bashrc and reload the terminal. After that cmake will find the nvcc # cuda 10.2
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
export PATH=$PATH:$CUDA_HOME/bin |
I got the same error with you, have you solved it? |
Make sure that you install CUDA after visual studio installation. I solved mine problem using that. Since CUDA visual studio integration doesn't work if visual studio is installed later. |
adding
|
|
This worked for me when it seemed like the wrong CUDA compiler was being picked up by cmake. Thanks! |
set(CMAKE_CUDA_COMPILER /usr/bin/nvcc) worked for me |
it worked after this on ubuntu 22.04
|
I have a similar issue to issue #12 but am unable to fix it (SOLVED-- see answer below). I am installing with CUDA 9.0 and the path to the compiler is in the usual location, /usr/local/cuda-9.0/bin/nvcc. The install with the script installLibrealsens.sh works fine without CUDA but fails when CUDA is selected.
The error is:
CMake Error at CMakeLists.txt:7 (project):
No CMAKE_CUDA_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.
I tried to export CUDACXX as /usr/local/cuda-9.0/bin and also as /usr/local/cuda-9.0/bin/nvcc and also as nvcc
but none of those helped. The PATH also contains /usr/local/cuda-9.0/bin
I tried modifying the CMakeLists.txt file that is generated with the CUDA option off. I changed the CUDA option to ON and added this line to the CUDA section:
set(CMAKE_CUDA_COMPILER /usr/local/cuda-9.0/bin/nvcc)
but I don't know how to use that CMakeLists.txt file to drive a new compile. If I just use "make" it does not update the compilation.
UPDATE: It has to do with ownership. If I run installLibrealsens.sh without sudo, then it finds the CUDA compiler but fails with:
/usr/local/cuda-9.0/bin: Permission denied
If I run the script as sudo, either with or without the -E option to keep environment variables, then it cannot find the CUDA compiler.
ANSWERED:
put
CUDACXX=/usr/local/cuda-9.0/bin/nvcc
into /etc/environment so that it is applied when using sudo.
The text was updated successfully, but these errors were encountered: