-
Notifications
You must be signed in to change notification settings - Fork 297
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
WSL2 + Docker + OpenGL + NVIDIA not working (uses llvmpipe) #288
Comments
@robertjbush which image is being used? Note that for OpenGL capabilities, the |
@elezar I believe I have tried those steps because:
Are you, or anyone else within NVIDIA corporation, successfully running NVIDIA OpenGL rendering within a docker container on a WSL2 host? |
Hi @robertjbush thanks for the additional information. It may be that @rboissel will be able to provide some additional insight here. |
One thing to note is that the graphics libraries are mounted from the host system, meaning that these need to be installed. Do Could you enable the The generated |
Yes they do. I'll work on the second part of your post now. |
@elezar I'm not getting those logs. This is my
This is at the end of my Docker Desktop JSON file
Some version info:
Can you provide any insight on this:
|
@robertjbush what command line are you using to launch the container? Since docker run --rm -ti --runtime=nvidia <image> nvidia-smi Alternatively, specifying the While looking for documentation w.r.t. WSL support, I also found: https://docs.nvidia.com/cuda/wsl-user-guide/index.html#features-not-yet-supported which lists OpenGL-interop as unsupported. |
@elezar I've used the
But OpenGL is used by so many applications. Why would this not be supported when it is available on the host? |
@elezar Is there a forum to request new features? |
@robertjbush let me ping someone to fine out where that limitation comes from as it may be related to WSL2 (although I recall reading that this now has better support for Linux graphics applications). If this is only due to the NVIDIA Container Toolkit I will create a ticket to track getting this added. |
@elezar WSL2 does indeed have better support for GPU graphics rendering. I can run OpenGL applications and use NVIDIA hardware to render them. But it isn't possible from a docker container when the host is WSL2 (the same container does use the NVIDIA GPU for rendering on a pure Ubuntu 20.04 install). |
I have pinged @rboissel to have a look at the ticket. He has a better grasp on the WSL2 specifics and where the noted limitations come from. |
@elezar @rboissel Good news in part:
Any ideas why this may happen? |
@robertjbush System Specs:
Thanks. |
@bejota OpenGL acceleration in WSL2 only works in Windows 11. |
Dang. I knew someone was going to say that. |
Anyone tested RViz and meshes using accelerated OpenGL in WSL? |
Friendly ping to anyone who's had this problem and solved it? |
Issue is being tracked in microsoft/wslg#554 |
I'm on windows 11 but I am trying to run full hardware accelerated apps from Docker. GPU (rtx2060 max Q) is working on docker containers for compute. But im sure GUI apps are not hardware accelerated in some way. I am facing the same issue where things like webgl are not working because glrenderer is set to
WSL2 Ubuntu 20.04
|
@moracabanas I think you are missing these:
Take a look at the samples. |
Thanks you for your suggestion. I tried the new configuration based on WLSG But I am still not getting OpenGL as
Chrome is still showing the same unsupported and blacklisted I tried This is my image launcher script for testing now:
|
You also need to install Mesa 21.x inside the container. |
I've been trying to install mesa for hours on somewhere other than Ubuntu distro and I give up. Do you have any advice to update or install mesa I.E any docker image? I don't want it to compile because in my experience, compiling software from source takes a day, mostly with errors. And also I don't know what I am doing in the process except copy pasting scripts. Things I've tried already:
This is not working as this repo only supports Ubuntu and has no candidate for my buster/bullseye Debian based docker image. |
@moracabanas On Debian bullseye you need to add the |
I updated my image with that and now I get:
Thanks you so much I am testing this now! |
@moracabanas glxgears is somewhat outdated. Try better |
Any updates on this one? |
How to solve this? To get GPU OpenGL renderer in docker container? In WSL2 $ glxinfo | grep "OpenGL"
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1050 Ti)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 23.0.2 - kisak-mesa PPA
OpenGL core profile shading language version string: 4.20
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.2 (Compatibility Profile) Mesa 23.0.2 - kisak-mesa PPA
OpenGL shading language version string: 4.20
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 23.0.2 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions: In docker container $ glxinfo | grep "OpenGL"
OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 23.0.2 - kisak-mesa PPA
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5 (Compatibility Profile) Mesa 23.0.2 - kisak-mesa PPA
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.0.2 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions: |
I successfully updated MESA from
WSL
Docker (before update)
I followed the guide here to update MESA. Mesa updated from Docker (after update)
I don't know that must be taken in account but I followed equally the guide here to enable WSLg in the container. Otherwise I have equally the following variables in my Dockerfile:
|
Summary
I am running ROS GUI applications like RViz and Gazebo through a docker container on WSL2. The OpenGL renderer is not selecting my NVIDIA GTX 1050 card and uses llvmpipe (CPU) instead.
My system:
Note "latest" refers to 07th October 2021 updates, I don't have versions numbers to hand
Steps taken to fix so far
The OpenGL renderer does find my NVIDIA card outside of a docker container on WSL2 (on the host). I have replicated the same issue after multiple reinstalls and using docker-ce instead of docker desktop. On a native Ubuntu 20.04 boot, the containers OpenGL renderer is correctly set to my NVIDIA card.
Expected Behaviour
RViz, Gazebo, GLXGears, glmark2 should all render with 3D hardware acceleration on the NVIDIA GPU.
The text was updated successfully, but these errors were encountered: