tcobbs / ldview

Real-time 3D viewer for displaying LDraw models
https://tcobbs.github.io/ldview/
GNU General Public License v2.0
86 stars 17 forks source link

Possibility to run in docker nvidia/cuda with GPU support #85

Open keeema opened 3 weeks ago

keeema commented 3 weeks ago

Is your feature request related to a problem? Please describe. I am trying to run ldview from python script in nvidia/cuda:12.5.0-runtime-ubuntu22.04 docker image on NVIDIA Tesla T4 in AKS. I have working container but watch -n0.25 nvidia-smi shows no precesses on GPUs and rendering is slow.

Describe the solution you'd like LDView is able to use GPUs in cuda container.

Describe alternatives you've considered

pbartfai commented 2 weeks ago

Which version do you use? Qt 4/5/6 OSMesa?

keeema commented 2 weeks ago

Qt5

keeema commented 2 weeks ago

Today I have also tried the osmesa. nvidia-smi still doesnt show any usage of GPUs, but it generates snapshots in same times as on my Mac M1 (no difference if I use AKS with GPU or without). So for me it doesnot make a sense that it still doesnt use GPUs even if I use node with GPUs, but the performance is OK for me now.

pbartfai commented 2 weeks ago

OSMesa uses software rendering, so it OSMesa version is working as designed.

Qt uses QOffscreenSurface class for rendering. It should use hardware acceleration.

Could you please check hw acceleration with other app to validate the environment?

keeema commented 2 weeks ago

The nvidia/cuda docker image check on start whether there asi available nvidia GPU or not and informs about it after pod is started. Checked on Mac - problem reported. Checked in AKS - successfully started without problem.

pbartfai commented 2 weeks ago

I guess you run LDView in headless mode in Docker.

What Qt Platform (QPA) do you use? It should be EGL.

Please refer to https://doc.qt.io/qt-5/embedded-linux.html https://forum.qt.io/topic/124174/qopenglfunctions-in-docker-headless-opengl/7?_=1725005495720&lang=en-US