Error “libGL error: unable to load driver: swrast_dri.so” on RHEL 9 with podman

Hello,

I’m attempting to run an openGL application (e.g. “glxgears” or “glxinfo”) from within a podman (docker) container on a laptop running RHEL 9. I’m getting errors along the line of “libGL error: unable to load driver: swrast_dri.so”.

Here’s some background:
We have been using this setup successfully for years using RHEL 7, Nvidia, and nvidia-docker on this hardware platform (Dell Precision 77xx). I’m tasked with getting this to run on RHEL 9.

As nvidia-docker is deprecated, my understanding is that the functionality it was providing is now a part of the Nvidia driver.

I have a laptop with a new RHEL 9 installation with the specs below:

Dell Precision 7770 / 32GB / Intel Core i7-12850HX
NVIDIA RTX A3000 12GB GDDR6

OS: RHEL 9.2
SELINUX: disabled
Nouveau: disabled
Nvidia Installation: cuda_12.2.1_535.86.10_linux.run
NVIDIA Driver: 535.86.10
CUDA Version: 12.2

RPMS (unsure if this is a listing of all relevant rpms):
[me@laptop ~]$ rpm -qa | egrep “mesa|GL|glv” | sort
libglvnd-1.3.4-1.el9.i686
libglvnd-1.3.4-1.el9.x86_64
libglvnd-core-devel-1.3.4-1.el9.i686
libglvnd-core-devel-1.3.4-1.el9.x86_64
libglvnd-devel-1.3.4-1.el9.i686
libglvnd-devel-1.3.4-1.el9.x86_64
libglvnd-egl-1.3.4-1.el9.i686
libglvnd-egl-1.3.4-1.el9.x86_64
libglvnd-gles-1.3.4-1.el9.i686
libglvnd-gles-1.3.4-1.el9.x86_64
libglvnd-glx-1.3.4-1.el9.i686
libglvnd-glx-1.3.4-1.el9.x86_64
libglvnd-opengl-1.3.4-1.el9.i686
libglvnd-opengl-1.3.4-1.el9.x86_64
mesa-dri-drivers-22.3.0-2.el9.x86_64
mesa-filesystem-22.3.0-2.el9.x86_64
mesa-libEGL-22.3.0-2.el9.i686
mesa-libEGL-22.3.0-2.el9.x86_64
mesa-libgbm-22.3.0-2.el9.i686
mesa-libgbm-22.3.0-2.el9.x86_64
mesa-libGL-22.3.0-2.el9.i686
mesa-libGL-22.3.0-2.el9.x86_64
mesa-libglapi-22.3.0-2.el9.i686
mesa-libglapi-22.3.0-2.el9.x86_64
mesa-libxatracker-22.3.0-2.el9.x86_64
mesa-vulkan-drivers-22.3.0-2.el9.x86_64
[me@laptop ~]$

I installed the RHEL 9 OS, and then installed only the following additional rpms and their dependencies:
dnf install libglvnd-devel
dnf install libglvnd.i686 libglvnd-devel.i686

After that, I followed documentation from NVIDIA indicating to best install the Nvidia driver with the cuda_12.2.1_535.86.10_linux.run script.

Next, here is an outline of the error I get when trying to run “glxgears” from within the container:

First a few checks:
[me@laptop ~]$ lsmod | egrep “nvidia|nouveau”
nvidia_uvm 3301376 0
nvidia_drm 81920 3
nvidia_modeset 1310720 3 nvidia_drm
nvidia 56586240 108 nvidia_uvm,nvidia_modeset
drm_kms_helper 192512 3 drm_display_helper,nvidia_drm,i915
drm 581632 22 drm_kms_helper,drm_display_helper,nvidia,drm_buddy,nvidia_drm,i915,ttm
[me@laptop ~]$

[me@laptop ~]$ echo $DISPLAY
:1
[me@laptop ~]$ xhost +
access control disabled, clients can connect from any host
Now start the container:
[me@laptop ~]$ podman run -it --hostname=a2devel --name=a2test --volume=$PWD/a2user:/a2user:rw --volume=$PWD/code:/home/a2user/code:rw --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw centos7:a2test-image

[a2user@a2devel ~]$ export DISPLAY=:1
[a2user@a2devel ~]$ xterm (This works!)

[a2user@a2devel ~]$ glxgears
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: iris
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 44
Current serial number in output stream: 46
[a2user@a2devel ~]$

[a2user@a2devel ~]$ glxinfo -v
name of display: :1
libGL error: MESA-LOADER: failed to retrieve device information
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: iris
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request: GLXBadContext
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 6 (X_GLXIsDirect)
Serial number of failed request: 59
Current serial number in output stream: 58
[a2user@a2devel ~]$

Can anyone provide help on this problem? It worked without a hitch on RHEL 7 with nvidia-docker so long as I installed things in the right order (with Nvidia driver last). Also, could someone confirm that the 32bit rpms are required?

Thank you!