# CuArray can't find libcuda

**URL:** <https://discourse.julialang.org/t/cuarray-cant-find-libcuda/34175>\
**Category:** GPU\
**Created:** [February 4, 2020, 4:41pm UTC](https://discourse.julialang.org/t/cuarray-cant-find-libcuda/34175 "2020-02-04T16:41:00Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![cuchxq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cuchxq/32/3830_2.png) [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Post date:** [February 4, 2020, 6:10pm UTC](https://discourse.julialang.org/t/cuarray-cant-find-libcuda/34175/7 "2020-02-04T18:10:47Z")

</div>

Thank you for the reply.

There is an entry:

```julia
$ 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

---

_[View the full topic](https://discourse.julialang.org/t/cuarray-cant-find-libcuda/34175)._
