Hi there,
I have an issue with my laptop that I can’t seem to get my head around.
I own a Dell XPS 15 7590 which have an integrated GPU and a discrete NVIDIA GPU:
$ nix shell 'nixpkgs#pciutils' -c lspci -k | grep -iEA2 'vga|3d'
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] (rev 02)
DeviceName: Onboard IGD
Subsystem: Dell Device 0905
--
01:00.0 3D controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
Subsystem: Dell Device 0905
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
02:00.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
Subsystem: Dell Device 0905
I followed the wiki to configure my drivers and NVIDIA Prime.
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = {
modesetting.enable = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.production;
powerManagement = {
enable = true;
finegrained = false;
};
prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
offload.enable = false;
sync.enable = true;
};
};
I have two external monitors:
- iiyama GB3467WQSU-B5
- Acer Predator XB271HUABMIPRZ
Both monitors are connected to my laptop and they work fine, however their maximum refresh rate (165Hz) is not available in xrandr:
DP-1 connected 3440x1440+0+0 (normal left inverted right x axis y axis) 800mm x 330mm
3440x1440 59.94*+
1920x1440 59.90
1600x1200 59.87
1440x1080 59.87
1400x1050 59.86
1280x1024 59.89
1280x960 59.94
1152x864 59.78
1024x768 59.68
800x600 59.86
640x480 59.38
320x240 59.52
1920x1200 59.88
1680x1050 59.95
1440x900 59.89
1280x800 59.81
1152x720 59.75
960x600 59.63
928x580 59.88
800x500 59.50
768x480 59.90
720x480 59.71
640x400 59.20
320x200 58.96
2560x1440 59.91
2048x1152 59.90
1920x1080 59.96
1600x900 59.95
1368x768 59.88
1280x720 59.86
1024x576 59.90
864x486 59.92
720x400 59.55
640x350 59.77
DP-3 connected 2560x1440+3440+0 (normal left inverted right x axis y axis) 600mm x 340mm
2560x1440 59.91*+
1920x1440 59.90
1600x1200 59.87
1440x1080 59.87
1400x1050 59.86
1280x1024 59.76
1280x960 59.94
1152x864 59.78
1024x768 59.68
800x600 59.86
640x480 59.38
320x240 59.52
1920x1200 59.88
1680x1050 59.85
1440x900 59.89
1280x800 59.81
1152x720 59.75
960x600 59.63
928x580 59.88
800x500 59.50
768x480 59.38
720x480 59.71
640x400 59.20
320x200 58.96
2048x1152 59.90
1920x1080 59.88
1600x900 59.82
1368x768 59.88
1280x720 59.86
1024x576 59.90
864x486 59.45
720x400 59.55
640x350 59.77
eDP-1 connected primary 1920x1080+1520+1440 (normal left inverted right x axis y axis) 340mm x 190mm
1920x1080 59.88*+
1440x1080 59.87
1400x1050 59.86
1280x1024 59.89
1280x960 59.94
1152x864 59.78
1024x768 59.68
800x600 59.86
640x480 59.38
320x240 59.52
1680x1050 59.95
1440x900 59.89
1280x800 59.81
1152x720 59.75
960x600 59.63
928x580 59.88
800x500 59.50
768x480 59.90
720x480 59.71
640x400 59.20
320x200 58.96
1600x900 59.95
1368x768 59.88
1280x720 59.86
1024x576 59.90
864x486 59.92
720x400 59.55
640x350 59.77
I’m using Gnome as my window manager, and in the Display settings I cannot change the refresh rate of any monitor at all:
I can see my GPU is available in nvidia-settings:
And it is also usable as a Docker container is using it:
mars 18 10:57:35 g-xps systemd[1]: Started docker-tabby.service.
mars 18 10:57:35 g-xps docker-tabby-start[18751]: 2024-03-18T09:57:35.809784Z INFO tabby::serve: crates/tabby/src/serve.rs:103: Starting server, this might takes a few minutes...
mars 18 10:57:35 g-xps docker-tabby-start[18751]: ggml_init_cublas: GGML_CUDA_FORCE_MMQ: no
mars 18 10:57:35 g-xps docker-tabby-start[18751]: ggml_init_cublas: CUDA_USE_TENSOR_CORES: yes
mars 18 10:57:35 g-xps docker-tabby-start[18751]: ggml_init_cublas: found 1 CUDA devices:
mars 18 10:57:35 g-xps docker-tabby-start[18751]: Device 0: NVIDIA GeForce GTX 1650, compute capability 7.5
mars 18 10:57:37 g-xps docker-tabby-start[18751]: 2024-03-18T09:57:37.056435Z INFO tabby::routes: crates/tabby/src/routes/mod.rs:35: Listening at 0.0.0.0:8080
I know that when I was using Arch I could use prime-select
to “force select” the NVIDIA GPU so that all applications would use it, but I can’t find a way to do that on NixOS and also I can’t find the prime-select
package.
So, in the end I have two questions:
- Does anyone have a clue as to how I should configure my system in order to be able to use my monitors at their maximum refresh rate?
- How should I configure my system to do the exact opposite of the Prime offload mode: always rely on the discrete GPU to run my applications?
Thanks for any input!