Nvidia Vulkan Driver NVK documentation

I’ve been hearing good things about the Mesa NVK Nvidia vulkan driver. I decided to dust off my old RTX 2080 and give it a spin today, so I went searching for how to install NVK. My use case for this machine is to run Steam on KDE plasma5. I’ve previously used the closed source driver and had mixed results with it. iirc suspend/sleep would have hilariously unproductive results.

I haven’t found much about NVK so far in the Nix ecosystem (wiki/options/packages/forums/etc). My first guess was that hardware.nvidia.open = true would get me Mesa and nouveau but the wiki dispelled me of that notion:

  hardware.nvidia = {
...
    # Use the NVidia open source kernel module (not to be confused with the
    # independent third-party "nouveau" open source driver).
...
    # Currently alpha-quality/buggy, so false is currently the recommended setting.
    open = false;

So I guess “open” is something else entirely. The only other mentions of nouveau in the article are about how to blacklist it.

At this point I have to guess that I’m overthinking things and I should just try booting without any particular nvidia configuration and that’ll result in getting the nouveau driver. I’ll give that a whirl and see how it goes. Until next time! :saluting_face:

1 Like

Pretty much. I swear it used to be documented more clearly here but you need to read between the lines a bit these days.

hardware.nvidia.open enables nvidia’s open kernel module, which is still not a mesa driver and therefore still has 99% of the issues of the proprietary driver. But it did kick(re)start the development of all these third party drivers - once again the FOSS community is doing all the work for literally one of the richest companies on earth, yay.

I’d be curious to hear if you actually get NVK to work, haven’t seen anyone try it around here.

2 Likes

You should look for Arch documentation. I recall you might need some module parameters regarding enabling GSP.

I don’t see any point to using NVK currently, based off my benchmarks. Even if it’s performance surpasses the open driver in the future there’d be extremely limited uses (I can only think of 1 or 2 that aren’t motivated by open-source evangelism).

1 Like

@eadwu That’s a pretty good point, I might be putting the cart before the horse here.

In any case, here’s how I got NVK running.

  • switched to nixos-unstable (stable only has up to kernel 6.6 just now)
  • boot.kernelPackages = pkgs.linuxPackages_6_8;

That puts me on kernel 6.8.4 with Mesa 24.0.3. Oddly, I thought NVK was only going to be available from Mesa 24.1 onward. But it looks like Mesa 24.0.3 will use it:

$ vulkaninfo | grep -i "deviceName\|driverID"
WARNING: NVK is not a conformant Vulkan implementation, testing use only.
        deviceName        = TU102
        driverID        = DRIVER_ID_MESA_NVK
...

At this point steam is throwing some error and I’ve already been shaving the yak all day so I might come back to this later. Here’s my GPU set in case it’s interesting:

$ doas inxi -G
Graphics:  Device-1: Intel Raptor Lake-S GT1 [UHD Graphics 770] driver: i915 v: kernel 
           Device-2: NVIDIA TU102 [GeForce RTX 2080 Ti Rev. A] driver: nouveau v: kernel 
           Display: server: X.org 1.21.1.11 driver: loaded: nouveau note: n/a (using device driver) 
           resolution: <missing: xdpyinfo> 
           Message: Advanced graphics data unavailable for root.

Linux 6.8 is available on stable NixOS 23.11 as well, as both pkgs.linuxPackages_latest and pkgs.linuxPackages_6_8.