Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build of GLMakie fails despite having a GPU card and drivers installed on Arch Linux #630

Closed
DoktorMike opened this issue Jun 15, 2020 · 6 comments

Comments

@DoktorMike
Copy link

DoktorMike commented Jun 15, 2020

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

@DoktorMike DoktorMike changed the title Build of GLMakie fails dispite having a GPU card and drivers installed on Arch Linux Build of GLMakie fails despite having a GPU card and drivers installed on Arch Linux Jun 15, 2020
@pdimens
Copy link

pdimens commented Jul 6, 2020

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

@lassepe
Copy link
Contributor

lassepe commented Aug 7, 2020

FWIW: There seems to be a workaround #486 (comment)

@ambiso
Copy link

ambiso commented Aug 25, 2020

For those failing to use Makie because of this - you can also use the WebGL Makie backend inside, for example, Pluto.jl: fonsp/Pluto.jl#155 (comment)

@jdm204
Copy link

jdm204 commented Aug 30, 2020

Have the same issue on Ubuntu 20.04.

@DaanVanHauwermeiren
Copy link

DaanVanHauwermeiren commented Sep 3, 2020

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!

@SimonDanisch
Copy link
Member

This should be the issue behind it: JuliaGL/GLFW.jl#198

This was referenced Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants