Command 'Nvcc' Not Callable from Shell Script

For my shell script, it is critical to check whether CUDA is installed by running nvcc --version. If I try to invoke it, it exits with following error:

./cuda.sh: line 17: nvcc: command not found

Note that I have CUDA installed and the command nvcc works when used in the console. For the nvcc command to work, some paths must be defined in the .bashrc (which they are), but elsewhere I have read that for non-interactive shell, it also has to be added to .profile, which I did. Despite this, the script still does not find the command.

What did I wrong and how can I fix this? Did I forget something?

Thanks for your help!

4
James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article