Nouveau Developer Working On NIR For SPIR-V Compute, Step Towards Vulkan In The Future

Written by Michael Larabel in Nouveau on 21 December 2017 at 04:20 PM EST. 9 Comments
There's some exciting news for open-source NVIDIA "Nouveau" driver users this holiday season!

Karol Herbst, a longtime community developer who for years has been working on Nouveau, has sent out a series of patches working on NIR support for the NVC0 Gallium3D driver!

But before getting to that NIR excitement, Karol Herbst who has been contributing to Nouveau the past 2+ years in his free-time is now working for Red Hat. We've known Red Hat was looking to hire more open-source GPU driver experts and he appears to be one of their latest hires with sending off this patch series from a email address. Ben Skeggs, the Nouveau DRM maintainer, is also a Red Hat developer. Congrats to Karol on his new job and hopefully will mean seeing more contributions to Nouveau.

Back to the 22 new patches, he's posted very early and experimental support for adding NIR support to Nouveau. NIR, of course, being the intermediate representation spearheaded by Intel for their Mesa driver and has since been picked up by Freedreno/VC4 and is experimentally supported in RadeonSI too for RADV/Vulkan interop support.

His goal in supporting NIR is to end up re-using SPIR-V to NIR support within Mesa. This in turn would mean getting SPIR-V, the IR used by OpenCL 2.1+ and Vulkan, working for the open-source NVIDIA driver. Two years back was some work by another developer on SPIR-V for Nouveau that was aiming to take SPIR-V directly to the NVIDIA instructions, but it didn't end up making too much headway. With going the NIR route, hopefully it will pan out and be brought up quicker.

Karol with this NIR/SPIR-V focus is on getting compute support working through NIR. With this NIR code there is also GLSL 1.30 era games working; currently this support with the patches is experimental and disabled unless setting the NV50_PROG_USE_NIR=1 environment variable.

Currently Karol is looking for feedback and has more work still left to get this Nouveau NIR support into shape. Features coming up next will be geometry shader handling and uniform buffer objects.

This NIR to NVIR code for Mesa so far is coming in at just over two thousand lines of code. So far there are just mentions of this code in the context of compute, but hopefully this will also be a big step towards seeing Nouveau Vulkan support. Vulkan on the open-source NVIDIA (Nouveau) driver would certainly be fun to see, but not too performant until re-clocking is sorted out for Pascal/Maxwell GPUs.

The patches for now can be found on Mesa-dev but will be interesting to see if the experimental, non-default code gets merged in time for Mesa 18.0.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week