# CUDA: CUDA driver not found

**URL:** <https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186>\
**Category:** GPU\
**Tags:** question\
**Created:** [July 18, 2024, 1:56pm UTC](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186 "2024-07-18T13:56:57Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [July 22, 2024, 2:50pm UTC](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186/21 "2024-07-22T14:50:56Z")

</div>

> [@giordano](#):
>
> No clue 🙂

To elaborate, this is the source code of the C function used to `stat` files:

> <https://github.com/JuliaLang/julia/blob/e621c74d52e095d740cede89e4e9da82d4f737a9/src/sys.c#L112-L124>

It’s basically using libuv’s [`uv_fs_stat`](https://docs.libuv.org/en/v1.x/fs.html#c.uv_fs_stat).

---

<div class="post-metadata">

**Author:** ![engram](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@engram](https://discourse.julialang.org/u/engram)\
**Post date:** [July 23, 2024, 9:40am UTC](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186/22 "2024-07-23T09:40:57Z")

</div>

haha indeed 😀  
Looking into the virtualisation I could figure it out. So in order to enable users access to different software from different machines they setup [modulefiles](https://modules.readthedocs.io/en/latest/modulefile.html) through which the environment can be changed on-the-fly e.g. add an entry to `PATH`. Thus users don’t have to setup software on their own and can switch between versions.

In my case `module load julia` added symlink named `julia` to the `PATH` variable. That symlink points towards a singularity wrapper that runs a singularity container in which julia is installed. Of course within the container the “new” driver library cannot be found if not bound/mounted. So adding

```julia
export SINGULARITY_BIND="${SINGULARITY_BIND},/lib/x86_64-linux-gnu/libcuda.so.535.161.08:/.singularity.d/libs/libcuda.so"

```

to my `.bashrc` mounts the driver, enables julia to find `libcuda.so` within the container. Consequenty `using Base.Libc.Libdl; dlopen("libcuda.so")` works, and also `CUDA.functional()` returns `true`.

In Hindsight I should have looked into that sooner.  
Thank both of you again for your time and advice!

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [July 23, 2024, 10:04am UTC](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186/23 "2024-07-23T10:04:10Z")

</div>

When you were running the C programs to try and reproduce the issue you were outside of the Singularity container, which explains why they were working fine?

---

<div class="post-metadata">

**Author:** ![engram](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@engram](https://discourse.julialang.org/u/engram)\
**Post date:** [July 23, 2024, 11:46am UTC](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186/24 "2024-07-23T11:46:53Z")

</div>

exactly! Only when using julia the container is run and julia is executed from within.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [July 24, 2024, 5:08am UTC](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186/25 "2024-07-24T05:08:21Z")

</div>

> [@engram](#):
>
> In my case `module load julia` added symlink named `julia` to the `PATH` variable. That symlink points towards a singularity wrapper that runs a singularity container in which julia is installed.

🤢

[Previous page](https://discourse.julialang.org/t/cuda-cuda-driver-not-found/117186.md?page=1)
