Vulkan & SSH

On Ubuntu 16.04, with driver 370.28 installed via PPA, GeForce 780, the Vulkan SDK 1.0.30 is running fine with a desktop.

However one of the interesting aspect of Vulkan is to run completely without any window manager. This can be leveraged for off-screen rendering on headless servers without having to deal with the plethora of windows system interfaces.

So I tried to run vulkaninfo via ssh and I got the following error:

INFO: [loader] Code 0 : Found manifest file /usr/share/vulkan/icd.d/nvidia_icd.json, version “1.0.0”
ERROR: [loader] Code 0 : Couldn’t get vkCreateInstance via vk_icdGetInstanceProcAddr for ICD
Cannot create Vulkan instance.
/var/lib/jenkins/workspace/Create-Linux-VulkanSDK/Vulkan-LoaderAndValidationLayers/demos/vulkaninfo.c:680: failed with VK_ERROR_INCOMPATIBLE_DRIVER

Source code for vulkaninfo:

It seems the Vulkan SDK loader can’t get the address of vkCreateInstance from the ICD in a SSH session.

I noticed that the only Vulkan ICD on my system is described by nvidia_icd.json and points to

I ran strace on vulkaninfo with a desktop and via ssh and compared the traces. They diverge at a socket() call, maybe to the X server.

Just found the same issue in the game dev forum.

The workaround is to install xorg and to define this:

export DISPLAY=:0