Nvidia Users Testers Requested (Sway on Nvidia, Steam on Wayland)

see here: Package new NVIDIA open-source GPU kernel modules · Issue #172603 · NixOS/nixpkgs · GitHub

5 Likes

Does anyone know what the current state of this is? I haven’t used my desktop in a few months, and when I went to update and rebuild, the machine just won’t come back up (I have to boot to a previous generation)

I had a running machine with nouveau+sway but the gui would randomly completely lock up. Just switched to nvidia and it seems like so far (after adding WLR_NO_HARDWARE_CURSORS) everything is “just working”. I’ll update if everything collapses at some point. Changes I made:

wayland.sway.extraSessionCommands = ''
        export WLR_NO_HARDWARE_CURSORS=1
      '';

hardware.nvidia = {
    package = config.boot.kernelPackages.nvidiaPackages.stable;
    modesetting.enable = true;
    prime = {
      nvidiaBusId = "PCI:1:0:0";
      intelBusId = "PCI:0:2:0";
      offload.enable = true;
    };
  };
hardware.opengl.enable = true;
services.xserver.videoDrivers = [ "modesetting" "nvidia" ];
[nix-shell:~/nixos-config]$ lspci -nnk | grep -iA2 vga
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] [10de:1f91] (rev a1)
	Subsystem: Lenovo Device [17aa:229f]
	Kernel driver in use: nvidia

This is on a Lenovo X1 Carbon gen 2, where the HDMI port is hardwired to the discrete GPU, and that seems to be just working with this setup. I haven’t tried testing Steam or games, but Google Meet and video playback is already working better than it was on nouveau.

Happy to can confirm that following the instructions on here is able to boot sway with the parameter --unsupported-gpu with a GT 1030, using the following configuration: nvidia: init commit -- no cursor, screen flickering · jhvst/nix-config@4bc3ab6 · GitHub

However, when built using nixos-unstable, it seems that the cursor is not showing up, and there is random screen flickering. Also, the gamescope package seems to be borked, but that’s not a huge deal. Overall, very happy about this, I tried various other configurations but without any success. Cheers!

Try with WLR_NO_HARDWARE_CURSORS=1 to fix the cursor issue.

It should be fine on master and unstable, there is currently a PR to fix the 22.05 release build but it looks like you are using unstable.

Using gamescope doesn’t necessarily “just work” and might have to be configured differently depending on how you are trying to use it. (from X, from wayland, from VT, hybrid graphics, etc). Feel free to DM me if you are lost.

1 Like

@nrdxp I would love some help, I am currently running unstable in my flake, gamescope runs via terminal with vcube, however with steam the game will not launch on nvidia even just running gamescope – %command% wont work

Some important things to know before I konw how to help:

Are you using an Nvidia Optimus Laptop?

  • if so, which screen do you want to output to, laptop or external?
  • Have you properly setup and tested render offload?

Are you using proprietary Nivida driver, or the recently open-sourced kernel modules?

Are you running NixOS, or which distro are you attempting this from?

What is your intended usecase for gamescope?

  • As a launcher for games from within an existing desktop (gamescope %command% in launch options)
    • if so, then what is the underlying display-server? X11 or wayland? Also which desktop or window manager?
  • As a full on desktop session itself to launch Steam in big picture mode (what I personally use)?

Also worth mentioning if you are on NixOS, I have an open PR that I am personally using in my own system currently to help manage a steam/gamescope session as a NixOS module. That way, once you get the settings you like you can have it pinned in your configuration.

Hi thank you for the reply. Currently using a desktop with no integrated graphics (so no optimus), so all my video output is from nvidia running on the proprietary driver since suspend is not working on the open source drivers as of yet.

Intended use case was to mess around with the application of it from my desktop session through steam to see how it works and the benefits of using it. Currently use xmonad on x11 for my main login, however, have been experimenting with Hyprland on wayland within the same nixconfig. I just have a few launch scripts depending on which session I want to head into!

Currently I was trying to test on a per game basis from the steam desktop client from the launch options which for a base gamescope showed to enter “gamescope – %command%” where you can add options as needed.

I really appreciate you trying to help and hope I am not creating any confusion. If it helps I can push my flake and dotfiles to github as well!

makes sense, but if you are looking for something like latency benefits, then running it as a desktop session is going to be the best solution.

If you could post your configs that’d be helpful too. Do you get any sort of error from trying to launch it? If you VT switch (ctrl-a-f*) and run gamescope -e steam -- -tenfoot does it work?

thanks a lot for the awesome work done here.
I got unlucky and first tried sway with a version of nixpkgs that was broken for nvidia (wayland 1.22 fixed it), e.g., sway wouldn’t start.
Understanding what tips were outdated, reading through error logs and trying to understand what all the WLR_* knobs do and if they could help me took a few hours.

Bumping nixpkgs fixed sway for my 3060 RTX. It then was flickering a lot.
Many report that export WLR_RENDERER=vulkan improves the situation so I tried but sway failed with

00:00:00.096 [DEBUG] [wlr] [render/vulkan/vulkan.c:111] Vulkan instance extension VK_LUNARG_direct_driver_loading v1
00:00:00.096 [ERROR] [wlr] [render/vulkan/vulkan.c:185] Could not create instance: ERROR_LAYER_NOT_PRESENT (-6)
00:00:00.096 [ERROR] [wlr] [render/vulkan/renderer.c:1794] creating vulkan instance for renderer failed
00:00:00.096 [ERROR] [wlr] [render/wlr_renderer.c:271] Failed to create a Vulkan renderer
00:00:00.096 [ERROR] [wlr] [render/wlr_renderer.c:333] Could not initialize renderer

cole helped me a ton and advised to use:

  hardware.opengl.extraPackages = with pkgs; [
    # trying to fix `WLR_RENDERER=vulkan sway`
    vulkan-validation-layers 
  ];

and that fixed it. 0 flickering now and I enjoy discovering the wayland scape (wayfire is fun).

2 Likes