guy_without_a_name
guy_without_a_name

Reputation: 155

CUDA: commands don't work after nvcc

I am trying to compile a .cu program with nvcc and after every time I try and compile in Unix, my commands no longer work. I get an error:

'command': command not found.

Why is that? I have to logout/exit after each time I compile.

[EDIT] I actually found that setting the path: setenv PATH /usr/local/cuda/bin causes the problem. Commands like: ls, pico, cd, etc. do not work. I can exit and logout

Upvotes: 2

Views: 567

Answers (2)

Robert Crovella
Robert Crovella

Reputation: 151972

You don't want to do setenv PATH /usr/local/cuda/bin You want to do setenv PATH $PATH:/usr/local/cuda/bin or some variant of that like setenv PATH $PATH":/usr/local/cuda/bin" When you do it your way, you are replacing your existing PATH definition, so you lose the command path to all those other commands. Try echo $PATH to see what it looks like before you change it. You want to add to it, not replace it.

Upvotes: 2

Moe
Moe

Reputation: 29743

You are deleting your path, you need to append to the PATH instead of overwriting it.

setenv PATH ${PATH}:/usr/local/cuda/bin

Upvotes: 4

Related Questions