VM with nvidia GPU, X and vulkan

Hi there,

I will describe my goal, the steps I have taken and my idea for a solution.

Goal: I have a VM with no monitor connected, but an NVIDIA Tesla K80. I want to use the machine to run a GUI application (Unreal Engine) that requires vulkan.

Steps: First I tried to use Xvfb and the like to get a graphical session on the machine via VNC. But Xvfb does not support vulkan. Then I tried to run Xorg. Now I have two cases:
a) dummy display driver (like here) or removing the ModulePath to the nvidia driver from the Xorg config : same as Xvfb, I guess the GPU is not really used at all in that case (?)
b) xorg config as generated by nvidia-xconfig. In that case vulkan works, but the application fails to start. Apparently SDL misses XRandR support (Warning: Could not initialize SDL: XRandR support is required but not available).
In case a) xrandr -q (works, so is in fact available and )gives
Screen 0: minimum 1152 x 864, current 1152 x 864, maximum 1152 x 864
default connected 1152x864+0+0 0mm x 0mm
1152x864 0.00*
in case b)
Screen 0: minimum 8 x 8, current 640 x 480, maximum 16384 x 16384
so there seems to be no output (true, as the machine is not connected to a monitor).

My extensive web search essentiall boils down to:
let the card think there was a connected screen, no 1 and no 2, and some at most half resolved issues which will follow in a reply, as I am allowed to post only 3 links.

I’m running ubuntu 18.04, the installed driver is nvidia-driver-440.

First, is my use case or my general approach totally unreasonable? Not much to find about this online.
Second, does anyone have an idea how a fake display approach can work?

Any help would be greatly appreciated after two days of unsuccessful search and trial and error :)


Please let me know if there is any more information I can give on the problem

For future reference: I was not able to solve the problem, but only to circumvent it by using a different VM type. (azure NV series instead of NC)
I also found another guy with a similar problem here

Still, if anyone wants to provide an explanation I would love to learn about the background :)