CuArray can't find libcuda

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 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 Edit: I put /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.

  1. Add the location of libcuda.so to LD_LIBRARY_PATH. In my case, the last line of the result shown with locate libcuda.so
    $export LD_LIBRARY_PATH=/usr/local/cuda-10.2/targets/x86_64-linux/lib/stubs/:$LD_LIBRARY_PATH

  2. 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 because Libdl.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

1 Like