I created a GPU instance on Google Compute engine with NVIDIA Tesla K80 attached. I have installed GPU drivers and CUDA based on this guide.

nvidia-smi check - ok.

nvcc -V check - ok

Now I am trying to make sure I can run headless rendering with OpenGL.

I tried this:

sudo nvidia-xconfig -a --use-display-device=none

to configure xconfig.


export DISPLAY=:0

Finally,running glxgears:

glxinfo | grep OpenGL

I am getting this error:

No protocol specified Error: unable to open display :0

My xorg.conf file looks like this:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 390.30  (buildmeister@swio-display-x64-rhel04-14)  Wed Jan 31 22:46:17 PST 2018
Section "ServerFlags"
     Option "IgnoreABI" "True"
     Option "nolisten" "True"
     Option "AutoAddDevices" "False"
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "nvidia" 0 0
Section "Files"
Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Tesla K80"
    BusID          "PCI:0:4:0"
Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
    Option         "UseDisplayDevice" "none"

What is missing in my config?

My OS: Ubuntu 16.04

  • Did you find a solution? – liorda Oct 2 '18 at 11:31

I'm not sure if the same thing applies as your running totally headless but I recently set up a Cloud Compute instance for VNC and to get OpenGL to work I had to follow this guide and install VirtualGL. https://virtualgl.org/Documentation/HeadlessNV

In your case you might only need to do:

sudo nvidia-xconfig -a --allow-empty-initial-configuration --virtual=1920x1200 --busid PCI:0:4:0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.