NVIDIA / NVIDIA/nvidia-container-toolkit

Doesn't work with OpenGL ES

Open
#931 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
Dominant language
Go
Stars
4.6k
Forks
592
Avg merge
1d 33m
Merged PRs (30d)
61

Description

From here on I will talk about how I tried to run in two containers: Ubuntu 22.04 and Ubuntu 24.04.

IMAGE=ubuntu:24.04
#IMAGE=ubuntu:22.04
docker run -it --name dev_test  -u root --net host --gpus all --runtime=nvidia -v /tmp/.X11-unix:/tmp/.X11-unix -e NVIDIA_DRIVER_CAPABILITIES=all -e DISPLAY=${DISPLAY}  ${IMAGE} /bin/bash

I also update the system and install the necessary packages in container.

export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get -y upgrade -y && apt install -y glmark2-es2 glmark2 mesa-utils

On both systems the command glxinfo | grep "OpenGL" output reads:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 4070 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 565.77
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 565.77
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 565.77
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

The glmark2 benchmark is also fine (the window starts, the horses and cubes spin), the output is as follows:

Image

But the benchmark glmark2-es2 behavior on Ubuntu 24 is really bad:
Image
That is, I see a completely black screen, I see that software rendering is used instead of my video card. On Ubuntu 22, there is an image in the window, but it is still the same software rendering.
Maybe I am doing something wrong? And yes, I need OpenGL ES for my application.

I also tried this, but there were errors there too:

> __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json glmark2-es2
Error: eglGetDisplay() failed with error: 0x3000
Error: eglGetDisplay() failed with error: 0x3000
Error: main: Could not initialize canvas

Finally I ran on the host (I got the expected behavior):
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report using the Ubuntu 22.04 and 24.04 Docker commands, then compare glmark2 with glmark2-es2 and the reported EGL environment variables. Start by checking the container's GPU and EGL behavior; done means OpenGL ES uses the NVIDIA GPU and glmark2-es2 initializes successfully rather than showing a black screen or 0x3000 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, ubuntu
Domain
infrastructure, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.