Hello everyone. I’m very new in NixOS ecosystem.
I want to configure Nvidia driver on my laptop, but I get confusing things in setup process. I inputted this configs in configuration.nix :
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Configuring Nvidia PRIME
hardware.nvidia.nvidiaSettings = true;
services.xserver.videoDrivers = ["nvidia"];
hardware.opengl.enable = true;
hardware.nvidia.modesetting.enable = true;
hardware.nvidia.prime = {
offload.enable = true;
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
};
hardware.opengl.driSupport32Bit = true;
hardware.nvidia.powerManagement.enable = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
But, Nvidia X Server Settings not showing GPU info and GNOME Settings can’t detect my GPU. I have comparisons from Fedora 37 (I dual boot with Fedora)
Did you find the GPU with lspci as the config mentions? Can’t help but notice it’s the exact same bus ID as the ones from the wiki, I’ve not seen those repeated in the wild before.
I think I have mistakes after checking lspci. I will try to change it immediately.
For nixos-hardware, my laptop or family types of my laptop (such as VivoBook, UltraBook, TUF, etc) is not listed on here. Only ROG series in here
If you are indeed using render offload and it appears that you are, then nvidia-settings doesn’t show anything currently. I opened a ticket for this a while back:
I anecdotally remember it working before, but it could just be a faulty memory. Unfortunatly I have no idea how to debug further, but the good news is that most functionality of your GPU should work, you just won’t see any information about it in the nvidia-settings GUI.
Well you don’t have to wait to actually use your GPU, since it works properly with render offload. You just won’t see any information about it in the nvidia-settings GUI until this is fixed. You can still view information abou the GPU and apps it currently has loaded with nvidia-smi as mentioned.
I dunno, I’ve never used that particular program. But I believe newer versions of gnome have a built in “launch with dGPU” option in the context menu (right-click).
There are a few environmental variables you can set to manually launch any program with the dGPU as well. There is a small little script for accomplishing that outlined in the wiki: https://nixos.wiki/wiki/Nvidia#Nvidia_PRIME