Install Linux nvidia drivers on CentOS 7 for headlesss OpenGL / GLX in server with multiple GPUs

I’m trying to set up headless OpenGL on a CentOS 7 server with multiple GeForce RTX 2080 TI GPUs but only want to use one GPU for OpenGL for data visualization, with the rest of the GPUs being made available for HPC compute technologies such as Tensorflow.

Whenever I try to set this up, I don’t seem able to get an RGB double-buffered visual, either via SSH X-forwarding in an SSH session, or via TurboVNC.

Note that OpenGL through Mesa drivers is not an option, unless I can get help with using it to obtain OpenGL version 3.2 or above, since the software I’m trying to set up in our HPC cluster requires it (the software being CaPTK:


You can’t use x forwarding for that, if you’re using vncserver, you’re connecting to a virtual software xserver.
You will have to set up a real Xserver running on the dedicated nvidia gpu and connect to that, either using x11vnc or by setting up virtualgl.

Ok thanks!
Are there any particular options I need to ensure usage of just the one GPU?
Or is it merely that I’d only specify the one GPU in a device stanza and include that device in the one screen stanza, as if it were the only GPU?

For that, create a xorg.conf just containing a device section and specify the gpu to be used by the BusID option.

Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    BusID          "PCI:1:0:0"
    Option         "AllowEmptyInitialConfiguration"

BusID takes decimal values. Depending on what you want to achieve, you might want to play with the options ConnectedMonitor and CustomEdid to fake a monitor.

Ok great, thanks!