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.
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.