# Cannot use CUDA nor GLMakie

**URL:** <https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742>\
**Category:** General Usage\
**Tags:** gpu, cuda, glmakie\
**Created:** [December 17, 2023, 6:45pm UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742 "2023-12-17T18:45:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simone\_Gabbriellini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simone_gabbriellini/32/202218_2.png) [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Post date:** [December 17, 2023, 6:45pm UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742/1 "2023-12-17T18:45:19Z")

</div>

might be two problems for two questions, but I am not sure if they might be related.

I have these nvidia drivers and CUDA:

```julia
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.147.05 Driver Version: 525.147.05 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla P4 Off | 00000000:21:00.0 Off | 0 |
| N/A 32C P8 6W / 75W | 2MiB / 7680MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+

```

and my OpenGL version is:

```julia
> inxi -G
Graphics: Card: NVIDIA GP104GL [Tesla P4]
           Display Server: X.Org 1.21.1.6 driver: nvidia Resolution: 1440x876@1.00hz
           OpenGL: renderer: Tesla P4/PCIe/SSE2 version: 4.6.0 NVIDIA 525.147.05

```

but when I try to use CUDA I get this error

```julia
julia> using CUDA
┌ Error: CUDA.jl could not find an appropriate CUDA runtime to use.
│ 
│ This can have several reasons:
│ * you are using an unsupported platform: this version of CUDA.jl
│ only supports Linux (x86_64, aarch64, ppc64le) and Windows (x86_64),
│ while your platform was identified as x86_64-linux-gnu-libgfortran5-cxx11-cuda+none-julia_version+1.9.4;
│ * you precompiled CUDA.jl in an environment where the CUDA driver
│ was not available (i.e., a container, or an HPC login node).
│ in that case, you need to specify which CUDA version to use
│ by calling `CUDA.set_runtime_version!`;
│ * you requested use of a local CUDA toolkit, but not all
│ required components were discovered. try running with
│ JULIA_DEBUG=all in your environment for more details.
│ 
│ For more details, refer to the CUDA.jl documentation at
│ https://cuda.juliagpu.org/stable/installation/overview/
└ @ CUDA ~/.julia/packages/CUDA/35NC6/src/initialization.jl:82

```

and when I try to use GLMakie I get this error:

```julia
julia> using GLMakie
[Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
┌ Warning: GLFW couldn't create an OpenGL window.
│ This likely means, you don't have an OpenGL capable Graphic Card,
│ or you don't have an OpenGL 3.3 capable video driver installed.
│ Have a look at the troubleshooting section in the GLMakie readme:
│ https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:250
ERROR: LoadError: GLFWError (VERSION_UNAVAILABLE): GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable
Stacktrace:
  [1] _ErrorCallbackWrapper(code::Int32, description::Cstring)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/callback.jl:43
  [2] CreateWindow(width::Int64, height::Int64, title::String, monitor::GLFW.Monitor, share::GLFW.Window)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:499
  [3] GLFW.Window(; name::String, resolution::Tuple{Int64, Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Vector{Tuple{UInt32, Integer}}, contexthints::Vector{Tuple{UInt32, Integer}}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window)
    @ GLFW ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:344
  [4] Window
    @ ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:302 [inlined]
  [5] empty_screen(debugging::Bool; reuse::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:241
  [6] empty_screen
    @ ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:222 [inlined]
  [7] singleton_screen(debugging::Bool)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/screen.jl:329
  [8] macro expansion
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:21 [inlined]
  [9] macro expansion
    @ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:78 [inlined]
 [10] macro expansion
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:18 [inlined]
 [11] macro expansion
    @ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:140 [inlined]
 [12] top-level scope
    @ ~/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:16
 [13] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [14] include(x::String)
    @ GLMakie ~/.julia/packages/GLMakie/29Rzq/src/GLMakie.jl:1
 [15] top-level scope
    @ ~/.julia/packages/GLMakie/29Rzq/src/GLMakie.jl:66
 [16] include
    @ ./Base.jl:457 [inlined]
 [17] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2049
 [18] top-level scope
    @ stdin:3
in expression starting at /home/gabby/.julia/packages/GLMakie/29Rzq/src/precompiles.jl:15
in expression starting at /home/gabby/.julia/packages/GLMakie/29Rzq/src/GLMakie.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/home/gabby/.julia/compiled/v1.9/GLMakie/jl_ja9ckG".
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base ./loading.jl:2294
 [3] compilecache
   @ ./loading.jl:2167 [inlined]
 [4] _require(pkg::Base.PkgId, env::String)
   @ Base ./loading.jl:1805
 [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
   @ Base ./loading.jl:1660
 [6] macro expansion
   @ ./loading.jl:1648 [inlined]
 [7] macro expansion
   @ ./lock.jl:267 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1611

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 17, 2023, 8:13pm UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742/2 "2023-12-17T20:13:34Z")

</div>

What is your output of:

```julia
versioninfo()

```

What is your output of:

```julia
using Pkg
Pkg.status()

```

---

<div class="post-metadata">

**Author:** ![Simone\_Gabbriellini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simone_gabbriellini/32/202218_2.png) [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Post date:** [December 17, 2023, 8:25pm UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742/3 "2023-12-17T20:25:37Z")

</div>

> [@ufechner7](#):
>
> `versioninfo()`

```julia
julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 64 × Intel(R) Xeon(R) CPU E5-4650 0 @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, sandybridge)
  Threads: 1 on 64 virtual cores
Environment:
  JULIA_COPY_STACKS = 1
  LD_LIBRARY_PATH = /usr/local/cuda-8.0/lib64

```

```julia
julia> Pkg.status()
Status `~/.julia/environments/v1.9/Project.toml`
  [fbe9abb3] AWS v1.90.3
  [46ada45e] Agents v5.17.1
  [336ed68f] CSV v0.10.11
⌅ [052768ef] CUDA v4.4.1
  [13f3f980] CairoMakie v0.11.3
  [a93c6f00] DataFrames v1.6.1
⌃ [31c24e10] Distributions v0.25.103
⌅ [587475ba] Flux v0.13.17
  [e9467ef8] GLMakie v0.9.3
  [cd3eb016] HTTP v1.10.1
  [682c06a0] JSON v0.21.4
  [8ef0a80b] Languages v0.4.6
  [739be429] MbedTLS v1.1.9
  [4d0d745f] PDFIO v0.1.14
  [92933f4c] ProgressMeter v1.9.0
  [2913bbd2] StatsBase v0.34.2
  [354b36f9] StringViews v1.3.3
  [61d0e4fa] Taro v0.8.5
  [21ca0261] Transformers v0.2.8
  [8ba89e20] Distributed
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`

```

also, I forgot to add that I am running an SSH session with X forwarding.

EDIT: I just realize that the LD\_LIBRARY\_PATH is pointing in the wrong direction!  
EDIT2: I have corrected the LD\_LIBRARY\_PATH and now it is pointing the the right direction but I still get the same error…  
EDIT3: the CUDA problem is fixed now, I have just updated to the latest stable version, 5.1.0

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [December 18, 2023, 8:12am UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742/4 "2023-12-18T08:12:26Z")

</div>

> [@Simone\_Gabbriellini](#):
>
> ` LD_LIBRARY_PATH = /usr/local/cuda-8.0/lib64`

You should not provide your own CUDA toolkit, or even set LD\_LIBRARY\_PATH at all. CUDA.jl will provide its own based on your driver.

---

<div class="post-metadata">

**Author:** ![Simone\_Gabbriellini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simone_gabbriellini/32/202218_2.png) [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Post date:** [December 18, 2023, 12:06pm UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742/5 "2023-12-18T12:06:58Z")

</div>

yes, thank you, I have removed the env variable and now CUDA loads just fine.

I guess the other problem with GLMakie is totally unrelated to this one and needs to be addressed in a separate question. I will open a new one and close this.
