Cannot use CUDA nor GLMakie

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

I have these nvidia drivers and CUDA:

| 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:

> inxi -G
Graphics:  Card: NVIDIA GP104GL [Tesla P4]
           Display Server: X.Org 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> 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
β”” @ CUDA ~/.julia/packages/CUDA/35NC6/src/initialization.jl:82

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

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:
β”” @ 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
  [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".
 [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

What is your output of:


What is your output of:

using Pkg
julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 64 Γ— Intel(R) Xeon(R) CPU E5-4650 0 @ 2.70GHz
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, sandybridge)
  Threads: 1 on 64 virtual cores
  LD_LIBRARY_PATH = /usr/local/cuda-8.0/lib64
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

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.

1 Like

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.