[[NixOS]]
# NixOS Nvidia Workarounds
## GPU is slow
https://www.reddit.com/r/NixOS/comments/lcbz8x/nixos_slow/
The profile used by default can be slow, set it to performance mode:
```nix
powerManagement.cpuFreqGovernor = "performance";
```
Your current power profile can be detected with:
```sh
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
```
Available profiles can be detected with the package `cpufrequtils`.
Temp install `cpufrequtils`:
```sh
nix-shell -p cpufrequtils
```
Check governor values:
```sh
cpufreq-info | grep "governor"
```
## Wake from suspend/sleep is broken
https://discourse.nixos.org/t/black-screen-after-suspend-hibernate-with-nvidia/54341/23
This will remove the corruption, but cause a black/blank screen instead:
```nix
hardware.nvidia.powerManagement.enable = true;
```
https://discourse.nixos.org/t/black-screen-after-suspend-hibernate-with-nvidia/54341/6
This will fix the black/blank screen:
> [!code] configuration.nix
>
> ```nix
> systemd.services."systemd-suspend" = {
> serviceConfig = {
> Environment=''"SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false"'';
> };
> };
> ```
---
https://discourse.nixos.org/t/psa-for-those-with-hibernation-issues-on-nvidia/61834
This was a temp workaround for a known nvidia bug, do not use if it works without as nvidia suggests it causes issues with GSP:
```nix
boot.extraModprobeConfig = ''
options nvidia_modeset vblank_sem_control=0
'';
```