Skip to content
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

nvcc path appears to be hardcoded as "/usr/local/cuda/bin/nvcc", mambaforge path is "~/mambaforge/bin" #142

Open
alwayssummer opened this issue Aug 10, 2022 · 3 comments

Comments

@alwayssummer
Copy link

I'm trying to compile the samples on Ubuntu 22.04 (minimal) after installing CUDA toolkit with mambaforge. I believe compile is failing due to the different location of nvcc.

~/mambaforge/cuda-samples$ make
make[1]: Entering directory '/home/user/mambaforge/cuda-samples/0_Simple/matrixMulCUBLAS'
>>> GCC Version is greater or equal to 5.1.0 <<<
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../common/inc -m64 --threads 0 --std=c++11 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o matrixMulCUBLAS.o -c matrixMulCUBLAS.cpp
make[1]: /usr/local/cuda/bin/nvcc: No such file or directory
make[1]: *** [Makefile:349: matrixMulCUBLAS.o] Error 127
make[1]: Leaving directory '/home/user/mambaforge/cuda-samples/0_Simple/matrixMulCUBLAS'
make: *** [Makefile:51: 0_Simple/matrixMulCUBLAS/Makefile.ph_build] Error 2

I tried the naive solution of copying nvcc to the expected directory, but then I get further compile errors.

/usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o matrixMulCUBLAS matrixMulCUBLAS.o -lcublas
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
cc1plus: fatal error: /usr/local/cuda/bin/crt/link.stub: No such file or directory

[How] Can I make this work correctly with CUDA toolkit from mambaforge?

@Rafik89
Copy link

Rafik89 commented Aug 22, 2022

I was do:

apt install nvidia-cuda-toolkit
mkdir /usr/local/cuda
cd /usr/local/cuda
ln -s /usr/lib/nvidia-cuda-toolkit/bin bin
ln -s /usr/include include
ln -s /usr/lib/x86_64-linux-gnu lib64
ln -s /usr/share share

@telepibe
Copy link

telepibe commented Sep 14, 2022

Hi @alwayssummer .

I just went trough the same problem. The solution is to set the environment variable CUDA_PATH to wherever you have the toolkit installed.
For example, I'm on Debian 11 and doing:
:~/Documents/cuda-samples$ CUDA_PATH=/usr make
compiles just fine.

In your particular case I guess you'll have to set it to CUDA_PATH="~/.conda/envs/cuda" or whatever your conda enviroment is located.

@philshem
Copy link

Hi @alwayssummer .

I just went trough the same problem. The solution is to set the environment variable CUDA_PATH to wherever you have the toolkit installed. For example, I'm on Debian 11 and doing: :~/Documents/cuda-samples$ CUDA_PATH=/usr make compiles just fine.

In your particular case I guess you'll have to set it to CUDA_PATH="~/.conda/envs/cuda" or whatever your conda enviroment is located.

Yes, this worked for me. I ran which nvcc and then added the path (without the trailing bin/)

export CUDA_PATH="/path/to/the/nvidia/compiler"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants