I will try to solve this problem clearly and concisely, as I did not find a very good answer for people who start using unix or are not familiar with compilation and links.
The problem is related to dynamic communication, and it can be solved in two ways. The first is setting the environment variable LD_LIBRARY_PATH. Assuming cuda is installed in / usr / local / cuda /, just add / etc / enviroment to the environment file:
LD_LIBRARY_PATH=/usr/local/cuda/
Or just in your bashrc:
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
This solution is not recommended by the unix guru (I am not the one I just read on the Internet and I follow the linux guru). So the solution I found is simple, change the path where linux ld looks for default libraries. To do this, just do it (you have to do it as root):
cd /etc/ld.so.conf.d/
Then select, for example, and edit:
vi libc.conf
Inside this file, just add the path to the lib64 root, for example:
/usr/local/cuda/lib64/
In the file you will get something like this:
\
And then just run:
sudo ldconfig
Hope this answer helps people who are starting to see programming, or using high-level languages ββlike python, which uses the C code below (like anano) and are not familiar with compilation, linkig ...
source share