Makie.jl: Build of GLMakie fails despite having a GPU card and drivers installed on Arch Linux

Created on 15 Jun 2020  ยท  6Comments  ยท  Source: JuliaPlots/Makie.jl

The error is as follows

pkg> build GLMakie
   Building ModernGL โ†’ `~/.julia/packages/ModernGL/rVuW2/deps/build.log`
   Building GLMakie โ”€โ†’ `~/.julia/packages/GLMakie/wpJsD/deps/build.log`
โ”Œ Error: Error building `GLMakie`:
โ”‚ libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/dri)
โ”‚ libGL error: failed to load driver: iris
โ”‚ libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/dri)
โ”‚ libGL error: failed to load driver: iris
โ”‚ libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/dri)
โ”‚ libGL error: failed to load driver: swrast
โ”‚ init error of GLFW
โ”‚ ERROR: LoadError: OpenGL/GLFW wasn't installed correctly. This likely means,
โ”‚ you don't have an OpenGL capable Graphic Card,
โ”‚ you don't have the newest video driver installed,
โ”‚ or the GLFW build failed. If you're on linux and `]build` GLFW failed,
โ”‚ try manually adding `sudo apt-get install libglfw3` and then `]build GLMakie`.
โ”‚ If you're on a headless server, you still need to install x-server and
โ”‚ proper GPU drivers. You can take inspiration from this article
โ”‚ on how to get Makie running on a headless system:
โ”‚ https://nextjournal.com/sdanisch/makie-1.0
โ”‚ If you don't have a GPU, there is also a Cairo software backend
โ”‚ for Makie which you can use:
โ”‚ https://github.com/JuliaPlots/CairoMakie.jl.
โ”‚ Please check the below error and open an issue at:
โ”‚ https://github.com/JuliaPlots/GLMakie.jl.
โ”‚ After you fixed your OpenGL install, please run `]build GLMakie` again!
โ”‚ GLMakie will still load, but will be disabled as a default backend for Makie
โ”‚
โ”‚ Stacktrace:
โ”‚  [1] error(::String) at ./error.jl:33
โ”‚  [2] top-level scope at /home/supersecret/.julia/packages/GLMakie/wpJsD/deps/build.jl:63
โ”‚  [3] include(::String) at ./client.jl:439
โ”‚  [4] top-level scope at none:5
โ”‚ in expression starting at /home/supersecret/.julia/packages/GLMakie/wpJsD/deps/build.jl:31
โ”‚ caused by [exception 1]
โ”‚ GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: GLXBadFBConfig
โ”‚ Stacktrace:
โ”‚  [1] _ErrorCallbackWrapper(::Int32, ::Cstring) at /home/supersecret/.julia/packages/GLFW/g1nX6/src/callback.jl:43
โ”‚  [2] CreateWindow(::Int64, ::Int64, ::String, ::GLFW.Monitor, ::GLFW.Window) at /home/supersecret/.julia/packages/GLFW/g1nX6/src/glfw3.jl:487
โ”‚  [3] GLFW.Window(; name::String, resolution::Tuple{Int64,Int64}, debugging::Bool, major::Int64, minor::Int64, windowhints::Array{Tuple{UInt32,Int64},1}, contexthints::Array{Tuple{UInt32,Integer},1}, visible::Bool, focus::Bool, fullscreen::Bool, monitor::Nothing, share::GLFW.Window) at /home/supersecret/.julia/packages/GLFW/g1nX6/src/glfw3.jl:338
โ”‚  [4] top-level scope at /home/supersecret/.julia/packages/GLMakie/wpJsD/deps/build.jl:34
โ”‚  [5] include(::String) at ./client.jl:439
โ”‚  [6] top-level scope at none:5
โ”” @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:892

Julia version

Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = nvim

GPU works

using CuArrays
cu(randn(10,10))
10ร—10 CuArray{Float32,2,Nothing}:
 -1.29028   -0.173954  -0.122509    0.612302   -0.00560228   1.86212    1.18256    -0.538791    1.52562     1.69545
  0.333288  -0.418066   0.520716    1.28106     1.0781       0.727451   0.872427    1.40712    -1.57114     2.28178
 -0.303821  -0.735051  -0.0820556   1.26057    -1.18827     -0.465157  -1.32857    -0.997585   -0.620837   -0.769065
 -0.610587   2.33636    0.241827    0.0653601   0.159754    -0.27624   -0.854466   -1.75802     0.4149      1.27193
 -0.272421   1.11754   -0.796252   -0.454884   -0.144527    -0.474672  -0.0879907   1.38329     0.0479331  -0.413288
  0.312627  -0.634729  -1.72213    -0.0300504  -0.346615    -0.639811   0.272099   -0.0753725   1.08136     0.706665
 -0.744879   0.401857  -0.923077   -0.970253   -0.0158947    0.438621   0.647026   -0.61923    -2.26012    -1.21236
  0.271685   0.332486   1.50899     1.01376    -0.516817     1.97097    1.0227      0.195126   -0.0302478   0.0127451
 -1.03196   -0.232076  -0.38786     0.291348    1.95004      0.816761  -0.911667    0.0458333   0.864825   -0.598791
  0.777597  -0.738238   0.11066    -0.229872   -0.203511     0.555229  -1.77667    -0.462367   -0.812875   -1.24531

System

                   -`                    michael@einstein
                  .o+`                   ----------------
                 `ooo/                   OS: Arch Linux x86_64
                `+oooo:                  Host: MACH-WX9 M15
               `+oooooo:                 Kernel: 5.6.11-arch1-1
               -+oooooo+:                Uptime: 3 hours, 33 mins
             `/:-:++oooo+:               Packages: 1508 (pacman)
            `/++++/+++++++:              Shell: zsh 5.8
           `/++++++++++++++:             Resolution: 3000x2000, 3840x2160, 3840x2160
          `/+++ooooooooooooo/`           WM: i3
         ./ooosssso++osssssso+`          Theme: Arc-Darker [GTK2/3]
        .oossssso-````/ossssss+`         Icons: Adwaita [GTK2/3]
       -osssssso.      :ssssssso.        Terminal: alacritty
      :osssssss/        osssso+++.       CPU: Intel i7-8550U (8) @ 4.000GHz
     /ossssssss/        +ssssooo/-       GPU: Intel UHD Graphics 620
   `/ossssso+/:-        -:/+osssso+-     GPU: NVIDIA GeForce MX150
  `+sso+:-`                 `.-/+oso:    Memory: 6092MiB / 15765MiB
 `++:.                           `-/+/
 .`                                 `/

My version of GLFW is Packages (1) glfw-x11-3.3.2-1

Most helpful comment

I had the same issue (exact same error) on my similar system and I was able to solve it.

System

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   daan@daan-latitude5401 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   ---------------------- 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   OS: Manjaro Linux x86_64 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Host: Latitude 5401 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ            โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Kernel: 5.7.17-2-MANJARO 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Uptime: 2 days, 4 hours, 8 mins 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Packages: 1272 (pacman), 7 (snap) 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Shell: bash 5.0.18 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Resolution: 1920x1080 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   DE: Xfce 4.14 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   WM: Xfwm4 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   WM Theme: Matcha-sea 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Theme: Matcha-sea [GTK2], Adwaita [GTK3] 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Icons: Papirus-Maia [GTK2], Adwaita [GTK3] 
                               Terminal: xfce4-terminal 
                               Terminal Font: Monospace 12 
                               CPU: Intel i7-9850H (12) @ 4.600GHz 
                               GPU: NVIDIA GeForce MX150 
                               GPU: Intel UHD Graphics 630 
                               Memory: 8905MiB / 31899MiB 

Julia version

Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

GLFW version

glfw-x11 3.3.2-1

To test GPU rendering / computation, I used this example from InteractiveChaos.

My julia environment looks like this:

  [61744808] DynamicalSystems v1.4.0
  [81850811] InteractiveChaos v0.9.0
  [ee78f7c6] Makie v0.11.0

I found that

The solution is launching Julia while forcing to use the dedicated GPU (NVIDIA GeForce MX150) instead of the integrated GPU (Intel UHD Graphics 630). I got the idea from this manjaro forum post. For an Nvidia GPU, you prefix the command with prime-run. Note that I am using PRIME to manage the hybrid graphics. More info on Nvidia on arch and PRIME on arch.

My code used for testing the solution:

$ prime-run /path/to/julia
julia> using Pkg
julia> Pkg.activate("/path/to/your/env/")
julia> Pkg.add.(["InteractiveChaos", "DynamicalSystems", "Makie"])
julia> #see link above for details about this InteractiveChaos example
julia> i = p_index = 1
julia> ds, p_min, p_max, parname = Systems.standardmap(), 0.0, 1.2, "k"
julia> t = "orbit diagram for the standard map"
julia> oddata = interactive_orbitdiagram(ds, p_index, p_min, p_max, i; parname = parname, title = t)

I used NVIDIA X server settings to verify that everything was run on the correct GPU.

I hope this helps!

All 6 comments

I too am having this issue on Arch Linux, using X11 and having installed GLFW via pacman. I tried downgrading GLFW with ]add [email protected] as one user reported it working, but that did not work for my system (Intel 10th-gen with Iris graphics).

FWIW: There seems to be a workaround https://github.com/JuliaPlots/Makie.jl/issues/486#issuecomment-670095965

For those failing to use Makie because of this - you can also use the WebGL Makie backend inside, for example, Pluto.jl: https://github.com/fonsp/Pluto.jl/issues/155#issuecomment-669323378

Have the same issue on Ubuntu 20.04.

I had the same issue (exact same error) on my similar system and I was able to solve it.

System

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   daan@daan-latitude5401 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   ---------------------- 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   OS: Manjaro Linux x86_64 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Host: Latitude 5401 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ            โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Kernel: 5.7.17-2-MANJARO 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Uptime: 2 days, 4 hours, 8 mins 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Packages: 1272 (pacman), 7 (snap) 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Shell: bash 5.0.18 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Resolution: 1920x1080 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   DE: Xfce 4.14 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   WM: Xfwm4 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   WM Theme: Matcha-sea 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Theme: Matcha-sea [GTK2], Adwaita [GTK3] 
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   Icons: Papirus-Maia [GTK2], Adwaita [GTK3] 
                               Terminal: xfce4-terminal 
                               Terminal Font: Monospace 12 
                               CPU: Intel i7-9850H (12) @ 4.600GHz 
                               GPU: NVIDIA GeForce MX150 
                               GPU: Intel UHD Graphics 630 
                               Memory: 8905MiB / 31899MiB 

Julia version

Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

GLFW version

glfw-x11 3.3.2-1

To test GPU rendering / computation, I used this example from InteractiveChaos.

My julia environment looks like this:

  [61744808] DynamicalSystems v1.4.0
  [81850811] InteractiveChaos v0.9.0
  [ee78f7c6] Makie v0.11.0

I found that

The solution is launching Julia while forcing to use the dedicated GPU (NVIDIA GeForce MX150) instead of the integrated GPU (Intel UHD Graphics 630). I got the idea from this manjaro forum post. For an Nvidia GPU, you prefix the command with prime-run. Note that I am using PRIME to manage the hybrid graphics. More info on Nvidia on arch and PRIME on arch.

My code used for testing the solution:

$ prime-run /path/to/julia
julia> using Pkg
julia> Pkg.activate("/path/to/your/env/")
julia> Pkg.add.(["InteractiveChaos", "DynamicalSystems", "Makie"])
julia> #see link above for details about this InteractiveChaos example
julia> i = p_index = 1
julia> ds, p_min, p_max, parname = Systems.standardmap(), 0.0, 1.2, "k"
julia> t = "orbit diagram for the standard map"
julia> oddata = interactive_orbitdiagram(ds, p_index, p_min, p_max, i; parname = parname, title = t)

I used NVIDIA X server settings to verify that everything was run on the correct GPU.

I hope this helps!

This should be the issue behind it: https://github.com/JuliaGL/GLFW.jl/issues/198

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grahamas picture grahamas  ยท  3Comments

AlexisRenchon picture AlexisRenchon  ยท  3Comments

asinghvi17 picture asinghvi17  ยท  5Comments

mohamed82008 picture mohamed82008  ยท  6Comments

daviehh picture daviehh  ยท  7Comments