Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 77439  / 3 Years ago, tue, october 5, 2021, 8:42:59

Installing the CUDA toolkit results in the following instructions being printed to the console.



Please make sure your LD_LIBRARY_PATH
for 64-bit Linux distributions includes /usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib


OR


for 64-bit Linux distributions add /usr/local/cuda-5.0/lib64 and /usr/local/cuda-5.0/lib
to /etc/ld.so.conf and run ldconfig as root



The following code in /etc/profile had no effect.


if [ -z "$LD_LIBRARY_PATH" ]; then    
LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib
else
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib
fi
export LD_LIBRARY_PATH

That is, rebooting and issuing echo $LD_LIBRARY_PATH showed the variable was not defined.


To try the alternative suggestion, I added the two lines to the file /etc/ld.so.conf so my file looks like this


include /etc/ld.so.conf.d/*.conf 
/usr/local/cuda-5.0/lib64
/usr/local/cuda-5.0/lib

Then I issued:


sudo ldconfig


then


echo $LD_LIBRARY_PATH


Still the environment variable was not set. How do I comply with the CUDA installation instructions shown above?


More From » cuda

 Answers
1

Put the following in .bashrc.



if [ -z $LD_LIBRARY_PATH ]; then
LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib
else
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib
fi
export LD_LIBRARY_PATH

[#34532] Wednesday, October 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allally

Total Points: 487
Total Questions: 106
Total Answers: 110

Location: Laos
Member since Sun, Jul 3, 2022
2 Years ago
;