@AndreasL I have the exact same problem (thinkpad T530 with Nvidia NVS5400M which uses Legacy390 driver). And I also had the exact same configuration as you. Up until a few days ago, it was working fine, I assume you run unstable. However after updating my channel and rebuilding nixos, I have the same problem now, nvidia driver doesnāt detect any displays and the system runs with software acceleration, so I assume something broke recently. (Note that offload isnāt supported in 390, so only sync mode works).
No Iām running on stable channel with NixOs 23.11.
Here is my config for my nvidia :
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
# It's important to just put "nvidia" and not "nvidiaLegacy390"
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
# see : https://nixos.wiki/wiki/Nvidia#Laptop_Configuration:_Hybrid_Graphics_.28Nvidia_Optimus_PRIME.29
prime = {
sync.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
# Needed for nvidia drivers
nixpkgs.config.nvidia.acceptLicense = true;
environment.systemPackages = with pkgs; [
# See https://discourse.nixos.org/t/nvidia-settings-and-nvidia-offload-not-found/37187/14?u=andreasl
linuxKernel.packages.linux_6_1.nvidia_x11_legacy390
];
My real problem is about HDMI sound output which doesnāt with nouveau, and works with nvidia legacy.
Otherwise, I wouldnāt mind using nouveau, I donāt need a great performancesā¦
Iām facing a very similar issue, I have old Hardware and trying to make it work:
I need to use nvidiaLegacy390 (GPU model: Nvidia NVS 300), I still use VGA (sorry guys lol)
why:
the OS works overall but the text is blurry on some places and Iām getting headache by watching the Screen, before I go to last option (buy an new PC with better hardware) Iām trying now to downgrade the kernel thanks to the hint from @shico
Iām a newbie in NixOS (I love it btw.) and in Linux but already setup a bit flake, home-manager - I was asking myself if I should build the kernel with --flake option, I guess yes? ah and for nvidia-settings commands I get command not found
Would appreciate if someone finds an solution, I would save some money
@AndreasL
Sorry for the late reply, Iāve just seen your post. Currently I have this configuration which works well on the latest stable version of NixOS.
(Will share only relevant parts, if you want the complete file, you can tell me)
Running nvidia-smi in this configuration doesnāt work of course. NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
You would have to use it like this optirun nvidia-smi:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.157 Driver Version: 390.157 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 NVS 5200M Off | 00000000:01:00.0 N/A | N/A |
| N/A 47C P0 N/A / N/A | 5MiB / 964MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
Thanks for your reply,
I tried to replicate your configuration, but got problems compiling it.
First, I was not using flake, so I activated it.
Then, my hardware-configuration.nix is specified to be automatically generated, so I didnāt touch it, so I copied all your hardware stuff in configuration.nix.
I think it quite OK but got a very obscure error when calling sudo nixos-rebuild switch :
warning: creating lock file '/etc/nixos/flake.lock'
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild', 'legacyPackages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild' or 'nixosConfigurations."nixos".config.system.build.nixos-rebuild'
Here is my flake.nix file (the system = system line was creating an error so I just copied the system value) :
Iām not sure why it does not work. Have you tried just getting it work with flakes first without the overlay for bumblebee?
[Update]:
Copying and pasting your code snippet in my editor showed an error, youāre missing a semi-column at line 93, after the closing brace of specialArgs.