Cuda on Slackware and Konsole problem

Hi guys, i recently installed the cuda sw on Slackware 13.37 using the ubuntu 10.04 toolkit like it’s written on an old topic of this forum. Everything works well but if I use nvcc or other cuda tools or I try to run a cuda program, if i’m trying on Konsole in bash mode it tells me that he can’t find nvcc nor cuda libraries… everything work well only if i run program and tools on the same Konsole where i installed sdk and toolkit. with Terminal, instead, everything works well even if i’m in bash mode… Someone try cuda on Slackware and have similar problem?? Of course now i work only with Terminal, but i’m curious to know how and why this happen…

Are all the path variables properly defined? Open Konsole and try with echo PATH

I’m using CUDA under Slackware for years, without any issues; at the moment, I’m installing from Redhat 6.0 package. As mentioned above, you need to add CUDA toolkit bin and lib/lib64 directory to your PATH and LD_LIBRARY_PATH environment variables manually. Also beware that -current recently upgraded to GCC 4.7, and this one is not supported by CUDA; so if you upgrade, you’ll need to install GCC 4.6 alongside in order to be able to use CUDA.

if i export manually PATH and LD_LIBRARY_PATH, as it is written on the manual, it works again, but why only in bash i must re export PATH and LD_LIBRARY_PATH every times i open a new Konsole, and if i use Terminal this not necessary? in my main folder i have created a .bashrc file where i export PATH and LD_LIBRARY_PATH as i found written on post to make work cuda on slckware… so, how i can export PATH and LD_LIBRARY_PATH in Konsole automatically?
thanks for answers

Hi,
this is because your shell inside Konsole is not a login shell, thus your aliases and extra environment variables are not sourced at starting. You can find here an explanation of this and a possible workaround (with “bash -l” as login shell rather than “bash”).
But this has nothing (at all) to do with cuda.

It depends on you computer configuration and which shell are you using. Bash has a file call .bashrc (this gets executed every time you start bash). There are as well some other files which define profiles. Here is mine on ubuntu. I also use Konsole.

PATH=/usr/local/cuda/bin:$PATH
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

export CUDA_BIN=“/usr/local/cuda/bin”
export PATH=$PATH:$CUDA_BIN
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64

export PATH=/usr/local/cuda/bin:$PATH
export LPATH=/usr/lib/nvidia-current:$LPATH
export LIBRARY_PATH=/usr/lib/nvidia-current:$LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/nvidia-current:/usr/local/cuda/lib64:/usr/local/cuda/lib:$LD_LIBRARY_PATH

I used this through 2 laptops and 3 new ubuntu different releases installation

well, i have the same .bashrc file, but i think is like Gilles says… this i a “problem” due to the shell inside Konsole is not a login shell, so it does not load any .bashrc file…

It is strange. I use Konsole with the .bashrc file I posted and it works. I guess I am missing something.

i have added a .profile file where i only set the command “bash -I”, like it was said in the link Gilles post, and now it works… maybe ubuntu load the .bashrc file when you start Konsole and slackware no… i don’y really know… but, as a matter of fact, now konsole work fine, and i can still read its aphorism XD