# Need help with Flux CUDA.jl warning and error message

**URL:** <https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146>\
**Category:** General Usage\
**Tags:** question, package, flux\
**Created:** [November 14, 2020, 2:27pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146 "2020-11-14T14:27:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![forestacorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forestacorn/32/19260_2.png) [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Post date:** [November 14, 2020, 2:27pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/1 "2020-11-14T14:27:54Z")

</div>

I need some help understanding the following Flux problem and hopefully finding a fix for it.

When I run **`using Flux`** on my desktop system I get the following warning and error messages:

```julia
┌ Warning: This version of CUDA.jl only supports NVIDIA drivers for CUDA 10.1 or higher (yours is for CUDA 9.1.0)
└ @ CUDA ~/.julia/packages/CUDA/0p5fn/src/initialization.jl:111
ERROR: InitError: Could not find a suitable CUDA installation

```

However running the same on my netbook runs normally without warnings or errors.

Both systems run Manjaro, an Arch based Linux operating system, and are fully updated. The desktop CPU is Intel with an NVIDIA based graphics card:

```julia
$ inxi -G
Graphics: Device-1: NVIDIA GF119 [GeForce GT 610] driver: nvidia v: 390.132 
           Display: x11 server: X.Org 1.20.9 driver: nvidia s-res: 1920x1200 
           OpenGL: renderer: GeForce GT 610/PCIe/SSE2 v: 4.6.0 NVIDIA 390.132

```

Whilst the netbook is AMD based with an AMD CPU and Radeon graphics chip:

```julia
$ inxi -G
Graphics: Device-1: AMD Wrestler [Radeon HD 6250] driver: radeon v: kernel 
           Device-2: Chicony CNF9055 Toshiba Webcam type: USB driver: uvcvideo 
           Display: x11 server: X.Org 1.20.9 driver: radeon s-res: 1024x600 
           OpenGL: renderer: AMD PALM (DRM 2.50.0 / 5.8.18-1-MANJARO LLVM 10.0.1) 
           v: 3.3 Mesa 20.2.1

```

I do not know if the above is relevant to the problem and I am uncertain where the problem lies and seek your guidance as to the cause, further investigation and if it may be fixed ?

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [November 14, 2020, 8:57pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/2 "2020-11-14T20:57:44Z")

</div>

Flux depends on CUDA.jl by default for GPU acceleration, so `using Flux` will always try to find and load GPU-related functionality. On a machine without nvidia drivers installed (e.g. your netbook), this will fail gracefully and not attempt to run any more CUDA-specific code. Think of it as the “CPU-only” mode.

When your machine _does_ have nvidia drivers installed (presumably because there’s an nvidia GPU attached to it), CUDA.jl will try to download and run an appropriate SDK based on your current driver version. I’m not sure what the minimal driver version is, but 390.132 is definitely too old (`nvidia-smi` reports 450.51.06 on my system). Can you update your driver at all? Assuming your GPU is supported on a relatively recent one, Flux + CUDA should work OOTB.

---

<div class="post-metadata">

**Author:** ![forestacorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forestacorn/32/19260_2.png) [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Post date:** [November 15, 2020, 3:01pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/3 "2020-11-15T15:01:09Z")

</div>

Much appreciate the clarification and enlightenment.

Yes the GPU is old and Manjaro will be dropping support for the 390 drivers in the coming months and recommend switching to the Nouveau driver, I will try that soon, it may be my work around for the Flux and CUDA.jl problem for now, other than removing the graphics card (a bit too drastic).

My whole desktop system is old, circa 2008, the latest Raspberry Pi may give me similar or better performance! So I am acutely aware I need new or more recent hardware, which is another way to fix the Flux problem, but that will have to wait until next year.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [November 15, 2020, 4:58pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/4 "2020-11-15T16:58:02Z")

</div>

Switching to Nouveau may actually resolve the error, since CUDA.jl looks for the proprietary driver IIRC. In the meantime, try setting the environment variable `CUDA_VISIBLE_DEVICES=""` and see if that works.

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [November 21, 2020, 12:30pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/5 "2020-11-21T12:30:27Z")

</div>

Hi. I too am on a system with old hardware which I won’t be able to change for a while. I have CUDA 6.5 running fine on this machine with the 390 driver. Are you saying that I could run this (or another) CUDA and be Julia-compatible if I switched to the Nouveau driver?  
BTW ‘using CUDA’ doesn’t give errors for me at the moment - just  
‘using Flux’.  
Thanks for any advice

---

<div class="post-metadata">

**Author:** ![forestacorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forestacorn/32/19260_2.png) [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Post date:** [November 23, 2020, 2:34pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/6 "2020-11-23T14:34:22Z")

</div>

> [@compleat](#):
>
> Are you saying that I could run this (or another) CUDA and be Julia-compatible if I switched to the Nouveau driver?

You are asking a bit of a novice at this at the moment, so others may give a better answer. It seems there are three different CUDAs involved here,

- CUDA.jl
- NVIDIA drivers for CUDA
- and CUDA, NVIDIA’s GPU programming toolkit

I am uncertain as to which CUDA you are refering to for ‘Julia-compatible’. For me it is the **drivers for CUDA** that have caused my `using Flux` problem. Since my original post I have switched to using Nouveau and now there are no warnings or errors with `using Flux`, as @ToucheSir explains, my machine no longer has NVIDIA drivers installed and Flux becomes “CPU-only” mode.

However despite the fine work of the Nouveau developers, video playback often flickers, jitters and judders on my system so I will likely switch back to the NVIDIA driver and:

> [@ToucheSir](#):
>
> try setting the environment variable `CUDA_VISIBLE_DEVICES=""`

I hope my response is of some help.

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [November 23, 2020, 5:11pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/7 "2020-11-23T17:11:49Z")

</div>

Thank you. Yes, I have successfully employed the last suggestion you quoted.

---

<div class="post-metadata">

**Author:** ![forestacorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/forestacorn/32/19260_2.png) [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Post date:** [November 30, 2020, 12:49pm UTC](https://discourse.julialang.org/t/need-help-with-flux-cuda-jl-warning-and-error-message/50146/8 "2020-11-30T12:49:13Z")

</div>

I had to learn a little more about using shell and environment variables in Linux to get this to work for me. Having now reverted to using the NVIDIA drivers, for smooth graphics and video, I had entered  
only `CUDA_VISIBLE_DEVICES=""` on the command line, which sets a **shell** variable, and `using Flux` still gave the same warning and error. I discovered I needed to enter

```julia
export CUDA_VISIBLE_DEVICES=""

```

which sets it as an **environment** variable and `using Flux` runs without warnings or errors.  
_(Thanks to this [page](https://linuxize.com/post/how-to-set-and-list-environment-variables-in-linux/) for educating me)_
