The missing piece of Desktop Linux & Linux VR
Linux is a kernel that is converting operating systems into commodity software and helping the growth of the computing industry. It's popular everywhere else except on the desktop.
Enthusiasts have had Linux desktops for a decade. They produce enormous value in capable hands. Though, some things could be done to allow desktops improve on Linux way beyond what it is on OSX and Windows today.
Linux didn't have properly documented and common userspace interface for dealing with bare displays. Userspace software was not able to enumerate a display from list and open a display for exclusive use.
It is possible to access a display exclusively, but it requires you to start an X11 instance with your app to it with an udev and a xorg.conf -file.
The new Vulkan graphics api came with an extension
VK_KHR_display that allows you to do the above things with accelerated graphics cards. But the interface isn't implemented into NVIDIA's drivers, nor much anywhere else yet. And I suppose it was only added into the spec for embedded devices.
Being able to enumerate your displays and access them would be important everywhere, especially on the desktop.
GPU resource sharing between processes
Vulkan Window System Integration (WSI) is a vast improvement over how graphics rendering works on Linux. Vulkan made it possible to draw graphics into a file without having to worry about which windowing system is present. It just works!
I recently proposed that there should be a way to draw in one application and read in another. I hope we would get some form of GPU inter-process communication through and implemented into Vulkan drivers. It would make a world of difference for VR, Video editing applications and desktop compositors.
The GPU inter-process communication could work like this:
- Allocate memory and semaphore with GPU IPC enabled.
- Optionally assign the PID and read/write permissions of the receiving process into the resource.
- Retrieve an unique identifier for the vulkan resource and pass the identifier through an IPC of your choice.
Lack of these features makes Linux unattractive and vulnerable for change
Early Oculus drivers had Linux support. Back then the HMD was treated like an additional display and handled by X11 windowing system. The apps got information to identify where the display is and open the window on the correct position on the desktop.
The Oculus released with a VR compositor that takes care the frames are correctly renderered and distorted for the HMD to show them. It vastly improved both the developer and the end-user experience of VR.
The support for linux was very likely dropped just because it's way too much effort to implement a portable VR compositor that would work in Linux. Because Linux does not have a well-documented and supported API for opening a display for exclusive presentation. And there's no way to pass GPU resources between every application.
Things have vastly improved recently. I hope people would make them improve further. It's going to be worth it.