pvserver or pvpython in docker cannot use GPU

I download headless version of paraview, and build it into docker.

My host machine installed nvidia driver properly, and configured navidia-docker2 successfully.

And I Use nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04 as my docker base image, and with opengl installed in docker.

But when I start pvpython or pvserver in docker , and try to connect it with outside paraviewclient or chrome, and check nvdia-smi, It’s shows that no GPU is in use.

I also download another python module like numba in docker , and write some python code to test it , and in this condition, nvidia-smi shows GPU usage. So it seems like my docker image is ok to support GPU. But why pvserver can’t use it?

I also tried pvserver in my host ubuntu machine, and nvidia-smi shows success GPU usage.

So is there any way to check why pvserver not use GPU in docker?

Did you use the EGL version of ParaView?

yes, both egl and mesa version tried, and they are the same result.

But when I run these code

from paraview.simple import *
openGLInfo = GetOpenGLInformation()

It’s got Mesa/X.org . And I checked it twice that the package is Paraview-5.11.1-egl-MPI-Linux-Python3.9-x86_64

Solved by replace base image:

#FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu22.04
FROM nvidia/opengl:1.2-glvnd-devel-ubuntu20.04

Thanks for reporting back your solution. Indeed, using the nvidia/opengl image ensure the EGL library from nvidia to be available.

After build and test this docker image on ubuntu successfully. I copied the image to another centos7 server, but on centos7 server, container from this docker image faild to use GPU.
pvpython strart with error error: gl_primitiveiD undeclared
But nvidia-smi in this container runs successfully.
And this time openGLInfo.GetVendor() returns Mesa/X.org

Does that centos7 server has the nvidia-runtime for its docker?

Yes, but not sure if it’s nvidia-runtime is ok. I tested in the container with nvidia-smi command , and it’s shows success info as in the host. I guess this may means gpu is successfully mounted to container.

Yes that’s the way to validate that part.

Are the supported driver version the same between your working ubuntu host and your centos?

Normally having a working image on one host should work on another one…

Did you reuse the same image (save/load) or did you rebuild it from your centos?

Yes, you are right. I just installed another version nvidia driver and it ok now. Thank you very much.

1 Like