Thursday 28 April 2016

bash - How to update PATH to find nvcc for CUDA 8.0?

I have one main PC and one laptop, which I use to connect to the main PC through ssh. I recently installed CUDA 8.0 through the runtime installation on the main PC when sitting in front of it. I executed all the steps from http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html and I was able to compile my code. However, I am not very frequently at the location of my main PC. Therefore, I would need to run code through ssh from my laptop. When I tried this, I got the error:



/bin/sh: 1: nvcc: not found
make: *** [.depend] Error 127



However, when looking at /usr/local/cuda-8.0/bin there is a command called nvcc. So I think it should be there. Next I checked the PATH and LD_LIBRARY_PATH variables. They appeared not to have the necessary links in it that are specified in step 6.1.1 in the link above:



export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}


However, when I perform those steps again through ssh, it still doesn't work. And after closing the session and restarting it gain, the PATH and LD_LIBRARY_PATH variables have reset themselves again.




I guess you somehow need to make the changes permanent and this will solve my nvcc problem, but I don't know how (It doesn't mention it in the installation guide). So therefore my real question:




How to make the changes in the PATH and LD_LIBRARY_PATH variables
permanent? Will this solve my nvcc problem or do you think there is
more going on?


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...