Headless Render without X, with OpenGL



Can anyone give me instructions to setup hardware accelerated Panda3D rendering without X on a server, using the pandagl (OpenGL) backend? The server has 3 NVIDIA P100 graphics cards and Ubuntu 17.10.

I have already tried out the instructions here - [Headless Screenshots) but I still get one of these errors -

:display:x11display(error): Could not open display “:0.0”. - when I run without sudo
Xlib: extension “GLX” missing on display “:0.0”. - when I run sudo

Can someone please help me fix these errors or provide complete instructions for a fully headless setup?