Podman vs GPU

Hi,
I would like to run a GUI application from inside a podman container.
At the moment I am able to open firefox using the following:

podman run \
    --interactive \
    --tty \
    --rm \
    --volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY" \
    --volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.lock:/tmp/$WAYLAND_DISPLAY.lock" \
    --env "WAYLAND_DISPLAY=$WAYLAND_DISPLAY" \
    --env XDG_SESSION_TYPE=wayland \
    --env XDG_RUNTIME_DIR=/tmp \
    --security-opt label=disable \
    fedora /bin/bash -c "dnf install -y firefox-wayland; firefox"

Firefox opens as expected but if I go to about:support, under the section Graphics:

Compositing | WebRender (Software)

Is there a way to let it use the GPU?

Thanks

I found a solution:

podman run \
    --interactive \
    --tty \
    --rm \
    --device /dev/dri \
    --volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY" \
    --volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.lock:/tmp/$WAYLAND_DISPLAY.lock" \
    --env "WAYLAND_DISPLAY=$WAYLAND_DISPLAY" \
    --env XDG_SESSION_TYPE=wayland \
    --env XDG_RUNTIME_DIR=/tmp \
    --security-opt label=disable \
    fedora /bin/bash -c "dnf install -y firefox-wayland mesa-dri-drivers; firefox"
2 Likes