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

GLMakie fails to run on a headless system on Ubuntu 22.04 #1953

Closed
Octogonapus opened this issue May 18, 2022 · 7 comments
Closed

GLMakie fails to run on a headless system on Ubuntu 22.04 #1953

Octogonapus opened this issue May 18, 2022 · 7 comments
Labels
GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie.

Comments

@Octogonapus
Copy link
Contributor

Octogonapus commented May 18, 2022

I am creating this issue so we can track how to get GLMakie to run on Ubuntu 22.04 in headless mode. Currently running into this error when using the setup that worked on 20.04:

libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
┌ 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/JuliaPlots/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/screen.jl:339
ERROR: LoadError: GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: GLXBadFBConfig

That is with these dependencies installed: build-essential cmake xorg-dev mesa-utils xvfb libgl1 freeglut3-dev from following this guide.
Julia v1.7.2. Makie v0.16.6. GLMakie v0.5.5. Ubuntu 22.04.

@t-bltg
Copy link
Collaborator

t-bltg commented May 18, 2022

Thanks, I'm trying to fix this on my side too, also in headless mode on 22.04.

Reproducer:

$ LIBGL_DEBUG=verbose LIBGL_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri: julia -e 'using GLMakie; display(Figure())'
libGL: screen 0 does not appear to be DRI2 capable
libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: [...]/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1)
libGL error: MESA-LOADER: failed to open swrast: [...]/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1) (search paths /usr/lib/x86_64-linux-gnu/dri:, suffix _dri)
libGL error: failed to load driver: swrast
┌ 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/JuliaPlots/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/screen.jl:339
ERROR: GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: GLXBadFBConfig

This is likely due to a glibc mismatch between the julia shipped binaries and libraries (here libstdc++.so.6) and the version shipped by 22.04 (glibc 2.35).

$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3) 2.35

Maybe this issue should go in GLFW.jl or ModernGL.jl, reproducer:

$ julia -e 'using GLFW; GLFW.Window()'

@Octogonapus
Copy link
Contributor Author

With the dependency libgl1-mesa-dri installed, I see swrast_dri.so inside /usr/lib/x86_64-linux-gnu/dri/, so I don't know why that search doesn't find it. Maybe need to do something like export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/dri/

@t-bltg t-bltg added the GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. label May 18, 2022
@Octogonapus
Copy link
Contributor Author

Updating LD_LIBRARY_PATH did not work but this did:

mkdir -p /usr/lib/dri/
ln -s /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so /usr/lib/dri/swrast_dri.so

Now getting this error:

libGL error: MESA-LOADER: failed to open swrast: /julia-1.7.2/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libLLVM-13.so.1) (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
┌ 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/JuliaPlots/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/screen.jl:339
ERROR: LoadError: GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: GLXBadFBConfig

@Octogonapus
Copy link
Contributor Author

@t-bltg Sounds like this has been reduced to this old issue then: JuliaGL/GLFW.jl#198

@t-bltg
Copy link
Collaborator

t-bltg commented May 18, 2022

Ha, good catch, this workaround works:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 julia -e 'using GLFW; GLFW.Window(); readline()'
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 julia -e 'using GLMakie; display(Figure()); readline()'

@Octogonapus
Copy link
Contributor Author

I would consider this closed, then. This is just JuliaGL/GLFW.jl#198 with different wrapping.

@t-bltg
Copy link
Collaborator

t-bltg commented May 18, 2022

Xref JuliaLang/julia#34276.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie.
Projects
None yet
Development

No branches or pull requests

2 participants