mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.5k stars 370 forks source link

accessing gpu for Mali G610 from docker in orangepi 5, on ubuntu 20 docker with host ubuntu 22. #531

Closed programmeddeath1 closed 2 months ago

programmeddeath1 commented 2 months ago

Dear Team,

I am trying to run one of the docker images for ROS provided on https://hub.docker.com/_/ros/tags in an orangepi SBC with an RK3588 chip that has a Mali G10 GPU

I am trying to run a 3D simulation that needs GPU access for proper rendering. I am currently exposing as many driver locations as possible, but still the docker image is not able to access the hardware rendering of the host machine

docker run -it --privileged -e DISPLAY=$DISPLAY --ipc=host --net=host --privileged  -v /tmp/.X11-unix:/tmp/.X11-unix:ro --device /dev/video0 --device /dev/video1  --device /dev/ttyACM0 --device /dev/ttyUSB0 --device /dev/dri/card0 --device /dev/dri/card1 --device /dev/dri/renderD128 --device /dev/dri/renderD129 --device /dev/dri/by-path/platform-display-subsystem-card --device /dev/dri/by-path/platform-display-subsystem-render --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --volume /dev/dri:/dev/dri --volume /usr/lib/aarch64-linux-gnu/dri:/usr/lib/aarch64-linux-gnu/dri --name delta-noetic-auth ros:noetic-ros-core-focal /bin/bash

The host machine uses the open source GPU drivers panfrost/pan CSF. The rendering of glxgears or any other GL application from within the docker is also defaulting to software rendering using llvmpip.

How would it be possible to get the docker to access the host hardware rendering? I believe it is done for nvidia devices but how can it be done for other devices? Is it something that can be solved if the proper driver folder access is given?

This is the LIBGL logs from within docker where it defaults to llvmpip- https://github.com/programmeddeath1/webhost/blob/master/opi_rockhip_driver_error

This is LIBGL logs from host where it is able to pick the proper drivers https://github.com/programmeddeath1/webhost/blob/master/proper_gpu_loaded.txt

When I run x11docker it tried to load the drive files, but still is not able to use the gpu drivers, it still defaults to llvmpipe https://github.com/programmeddeath1/webhost/blob/master/x11docker_error

mviereck commented 2 months ago

Did you install the drivers in the image? The image should contain the same drivers as the host.

programmeddeath1 commented 2 months ago

I installed the GPU driver files, but the GPU installation for this SBC is slightly complicated and thus it seems the default hardware firmware will also have to be replicated which seems like an extremely tedious process requiring understanding of the SBC's OS firmware architecture. Ill have to dig deep and check.

Thanks for your response!