Thank you for the reply.
There is an entry:
$ sudo cat /etc/ld.so.conf.d/cuda-10-2.conf
/usr/local/cuda-10.2/targets/x86_64-linux/lib
Looking at where Edit: I put libcuda.so
is located, I notice there is one more level down the directory where libcuda.so (…/lib/stub/libcuda.so). But adding /stubs
to the conf file didn’t solve the issue/usr/local/cuda-10.2
in cuda-10-2.conf
file, and reboot, and it worked, too.
Eventually, I solved this by doing one of the following.
-
Add the location of
libcuda.so
to LD_LIBRARY_PATH. In my case, the last line of the result shown withlocate libcuda.so
$export LD_LIBRARY_PATH=/usr/local/cuda-10.2/targets/x86_64-linux/lib/stubs/:$LD_LIBRARY_PATH
-
Or make a link in
/usr/lib/x86_64-linux-gnu/
$sudo ln -s /usr/lib/x86_64-linux-gnu/libcuda.so.1 /usr/lib/x86_64-linux-gnu/libcuda.so
I found out this solution becauseLibdl.dlopen("libcuda.so.1")
works.
Given that not everyone have sudo privilege, maybe the first one is a better solution.
Thanks for your help! @maleadt