NVK and future plans for open source Nvidia

Quote from Collabora developer Jason Ekstrand, sorry it is a bit of a cut and paste summery from his page. But his page link bellow. All blame for any inconsistencies give to me…

“For the past several months, I’ve been working on writing a brand new open-source Vulkan driver for NVIDIA hardware in Mesa called NVK. This new driver has primarily been written by myself (Jason Ekstrand), along with Karol Herbst and Dave Airlie at Red Hat. In the last month or two, we’ve started picking up a few commits here and there from community folks and I’m hopeful that community involvement will only increase going forward.

Why NVIDIA? Why now?

Support for NVIDIA hardware in open-source drivers has always been somewhat lacking. The nouveau drivers exist but they’re often missing features, buggy, or just don’t support certain cards. This is due to a combination of factors. Unlike the Intel and AMD drivers, nouveau driver stack has been developed with little to no official documentation or help from NVIDIA. They occasionally provide little bits of support here. Historically, it’s been mostly focused on enabling nouveau just enough that you can install your Linux distro, get to a web browser, and download their proprietary driver stack.”

“There are a few things which have changed recently to make the technical landscape a bit more friendly. The first change actually happened a few years ago when NVIDIA launched their Turing class of hardware. Turing GPUs use a new unified firmware blob. The GSP firmware contains everything needed for bringing up the GPU, and once the GSP firmware is loaded, it loads all the other firmwares needed by various pieces of the GPU. If we can get GSP working, this will allow us to use the same firmware as the proprietary NVIDIA drivers and should solve many of the mystery bugs. Dave Airlie gave a very good talk at LPC about this.

Second: a few months ago, NVIDIA released an open-source version of their kernel driver. While this isn’t quite documentation, it does give us something to reference to see how NVIDIA drives their hardware. The code drop from NVIDIA isn’t a good fit for upstream Linux, but it does give us the opportunity to rework the upstream driver situation and do it right.”

“Third: NVIDIA has started providing official headers for the 3D and compute hardware. While this isn’t as good as real documentation either, it at least gives us names for all the registers we’ve been programming. Mesa developers working on nouveau have figured out a lot about how the hardware operates the hard way by reverse engineering, but the nouveau driver is still full of mystery bits shoved into mystery registers. We now finally have names for all those bits!”

“One of my personal goals for NVK is for it to become the new reference Vulkan driver within Mesa. All of the Vulkan drivers in Mesa can trace their lineage back to the Intel Vulkan driver (ANV) and were started by copying+pasting from it. We won’t be there for a while, but my hope is that NVK will eventually become the driver that everyone copies and pastes from. To that end, I’m building NVK with all the best practices we’ve developed for Vulkan drivers over the last 7.5 years and trying to keep the code-base clean and well-organized.

I’m also trying to build NVK to be as modern as possible, using it as motivation for developing the common Vulkan runtime code in Mesa. Copy+paste from other Vulkan drivers is kept to a minimum. Instead, whenever I’m tempted to copy+paste from ANV or some other driver, that’s an indication to me that we need more common framework code."

"Long-term, the hope is for NVK to be for NVIDIA hardware what RADV is to AMD hardware. However, that’s a pretty high bar. RADV is a quite mature driver with a lot of features and fantastic run-time performance. There’s a lot of work between where we are now and RADV-level driver quality, but it gives us a goal.”