3 ms·
I would expect something like Steam gaming on my dual-GPU laptop might be one deep mineshaft of "nope" on NixOS.
by troad 4y ago
I would expect something like Steam gaming on my dual-GPU laptop might be one deep mineshaft of "nope" on NixOS.
- Filligree 4y agoNo, that works fine. As well as it ever does.
- troad 4y agoReally? I'm curious to read more. It works very well for me under Ubuntu these days, but if I can get it working equivalently well on NixOS I may legitimately consider switching.
- Jhsto 4y agoPlugging my own thing here, but I have been experimenting with a Nix configuration for gaming only. My configuration is here (for Nvidia, which does not work without tinkering as AMD does) : https://github.com/jhvst/nix-config/blob/main/nvidia.nix https://github.com/jhvst/nix-config/blob/main/nvidia.nix First, this is a whole system specification. This means that executing this on Nix will build you a whole OS image. You can build the image if you have Nix by running the first line on file. You can also use Docker with the instruction on my README: https://github.com/jhvst/nix-config https://github.com/jhvst/nix-config (however, kexec will not likely work, read more how to run it later) Back to elaborating on the Nix file from the gaming perspective. First, we have the overlays. These are like patches to the packages, and really useful for gaming because it allows building important packages like mesa from the source tip. This is particularly useful when new games or GPUs are released. Same thing for wayland: Nvidia and its proprietary drivers need some patching, but it's possible to get wayland (and sway) to work this way. Then, I have taken the reproducibility of Nix to a next step in my opinion, and made the system stateless. This means that it runs from the RAM. It is easy to create installation media like kernel, initrd, and rootfs because you have all the steps to create the distribution. This means that here, Nix works as a meta-distro like Gentoo, on top of which you develop your own. Running from the RAM means that theoretically, if you have a working config, and two people with different hardware runs it, then they should have the same experience. If you look at ProtonDB, you often find that some people claim that game X works on their machine with drivers and mesa of Y and Z, but there is no way to copy their configurations because it's certain that the user has made some stateful changes which they have forgotten hence left undocumented, which is the reason it works for them. If everyone would be using Nix, you could reproduce their system and possibly fix your own, but this is not tractable with most OSs. If you like to test my changes, you can read more about my approach here: https://github.com/NixOS/nixpkgs/pull/203750 https://github.com/NixOS/nixpkgs/pull/203750 For testing I distribute Nvidia as documented here: https://github.com/jhvst/jhvst.github.io/blob/main/ramdisk.md https://github.com/jhvst/jhvst.github.io/blob/main/ramdisk.m... However, I have developed it bit further: if you manage to get into an iPXE shell, you can write `boot -a http://boot.ponkila.com/menu.ipxe http://boot.ponkila.com/menu.ipxe`, then select the second option which is Nvidia (proprietary drivers), and with some waiting you will get into a shell prompt to which you can write `sway --unsupported-gpu`, which will launch sway. Cmd+Enter opens a prompt to which you can write `steam`, which will open Steam. Then, you have to mount some drive on another shell with `mount`, and add this as a Steam library via Steam's UI. Then you can play games. I use this on AMD and I have been very happy. To get iPXE, the easy option is to go along with https://netboot.xyz https://netboot.xyz. You will find the `iPXE shell` option here to which to write the boot option from the previous paragraph. I also added AMD to the iPXE menu for whomever decides to test it. Sway is launched by writing `sway`. Steam should be started with `AMD_VULKAN_ICD="RADV" VK_ICD_FILENAMES="/run/opengl/driver/share/vulkan/icd.d/radeon_icd.x86_64.json" steam` to use the faster RADV driver.
- tmnvdb 4y agoI use steam on nix and it was a breeze.
- _piif 4y agoIf it's an Intel iGPU + an Nvidia dGPU setup beware there's a bug with the implementation of the Nvidia driver currently which breaks connecting external displays on X11 depending on your hardware. See https://github.com/NixOS/nixpkgs/issues/199024 https://github.com/NixOS/nixpkgs/issues/199024 and the comments of https://github.com/NixOS/nixpkgs/pull/165188 https://github.com/NixOS/nixpkgs/pull/165188. Also setting Coolbits doesn't seem to work either on my end, which means no overclocking support for the Nvidia GPU (if that's something you care about).
- thomastjeffery 4y agoI can't speak to that specific use case, but in a more general sense... NixOS, just like any other OS, can have you walking down the familiar caverns of, "getting the thing to work that this system isn't designed to accommodate well." But this time is different: you can start over fresh at any time. This is really the situation where NixOS shines the most. No more, "wondering what you installed where when you were trying to get that over program working the other day." No more, "did I just do the steps in the wrong order?" It's unbreakable. Your OS is guaranteed to feel like a fresh install. Forever. Because it can't be anything else.
- pxc 4y agoNixOS actually handles NVIDIA hybrid graphics more easily than most distros. When I got a laptop with NVIDIA/Intel hybrid graphics a few years ago, it took less time to configure on NixOS than it had on openSUSE, which I was dual-booting at the time. I don't have a laptop like that anymore, but check the NixOS manual and NixOS.wiki, and ask around if you get stuck! (When I last used it, Bumblebee was the best option and worked well, but these days, native PRIME offloading should also work fine and it's what I would prefer.) As for Steam, just add programs.steam.enable = true; to your config. Works great! (If you're accustomed to Flatpak Steam, you can alternatively enable Flatpak and just install Steam that way, like you would on your existing distro.)