Haiku ❤ Nvidia (porting Nvidia GPU driver)

As many people already knows, Nvidia published their kernel driver under MIT license: GitHub - NVIDIA/open-gpu-kernel-modules: NVIDIA Linux open GPU kernel module source (I will call it NVRM). This driver is very portable and its platform-independent part can be compiled for Haiku with minor effort (but it need to implement OS-specific binding code to be actually useful). This is very valuable for Haiku because Linux kernel GPU drivers are very hard to port and it heavily depends on Linux kernel internals. Unfortunately userland OpenGL/Vulkan driver source code is not published. But as part of Mesa 3D project, new Vulkan driver “NVK” is being developed and is functional already. Mesa NVK driver is using Nouveau as kernel driver, so it can’t be directly used with NVRM kernel driver. NVK source code provides platform abstraction that allows to implement support of other kernel drivers such as NVRM.

I finally managed to make initial port NVRM kernel driver to Haiku and added initial NVRM API support to Mesa NVK Vulkan driver, so NVRM and NVK can work together. Some simple Vulkan tests are working.

Driver will support Turing+ GPUs only because older GPUs have no GSP microcontroller so it are not compatible with NVRM kernel driver. But newer Nvidia GPUs up to latest ones should be supported.

56 Likes

Ilya dazzled us again with the improbable. There are great engineers, and then there is X512 :grin:

14 Likes

Thats super cool. Ill get a haiku machine soon again. How long will it take until complete 3d is working? Just asking.

3 Likes

MSI GEFORCE RTX 2070 Aero ITX 8192MB 256BIT GDDR6 is ready for testing!

2 Likes

How can I test?

1 Like

Amazing work, thank for keeping track on this! :100:

Great job @X512! When it’s ready it would be interesting to see if llama.cpp, compiled with Vulkan enabled, can offload the model layers to the GPU.

3 Likes

There’s this ticket I opened for Nvidia Geforce RTX 40xx generation of cards:

https://dev.haiku-os.org/ticket/18625

Maybe it would be possible to implement parts of the pscnv driver together or update drivers for old cards, but it would take some effort!

Is it still the plan to use NVK + Zink for OpenGL support?

1 Like

Great work putting the pieces together! I’ve looked at the Linux DRM/DRI docs more than a few times to think about how things could be brought over, but as you say, nothing in there is particularly portable. There’s something quite poetic about Haiku being able to bypass years of Linux specific tech and jump straight to a clean Vulkan implementation.

Is your port of this in a public repo? Would love to poke about with it over the weekend. I’ve got a 2080 in my machine and boot Haiku natively so happy to just help test too.

1 Like

Yes, it is planned to use Zink for OpenGL. It is already demonstrated that Zink can work on Haiku.

10 Likes

I’d love to test on my 3060!

1 Like

And I can test it on my 4090. It turns out there are plenty of Haiku fans with modern GPUs.

1 Like

I’ll also happily test it on my Geforce 6100 nForce - oh wait…

Awesome work. I will have to consider buying from Nvidia again.

Architecture Curie

Release Date Oct 11th, 2004

Too too old. Turing+ is required.