Hi Maybe somebody can advise on how to setup correctly NVIDIA Optimus via PRIME for the new laptop.
Current Hardware Configuration:
Intel and Nvidia RTX 4000 on laptop
lspci | grep -i VGA
00:02.0 VGA compatible controller: Intel Corporation Device 3e9b (rev 02)
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1eb6 (rev a1)
nvidia-smi
Sun Sep 22 15:24:13 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21 Driver Version: 435.21 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro RTX 4000 Off | 00000000:01:00.0 Off | N/A |
| N/A 37C P8 8W / N/A | 98MiB / 7982MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 3346 G ...bxhy9vnr16qpyn-xorg-server-1.20.5/bin/X 94MiB |
| 0 3484 G /run/current-system/sw/bin/nvidia-settings 2MiB |
+-----------------------------------------------------------------------------+
xrander --listproviders
Providers: number : 2
Provider 0: id: 0x28d cap: 0x1, Source Output crtcs: 4 outputs: 3 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x43 cap: 0x2, Sink Output crtcs: 3 outputs: 1 associated providers: 1 name:modesetting
Current NixOs Configuration
hardware = {
opengl.driSupport32Bit = true;
nvidia = {
optimus_prime = {
enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
modesetting.enable = true;
};
};
services = {
xserver = {
enable = true;
# videoDrivers = [ "intel" ];
videoDrivers = [ "nvidia" ];
layout = "us";
xkbOptions = "eurosign:e";
libinput.enable = true;
desktopManager = {
default = "none";
xterm.enable = false;
};
displayManager = {
lightdm = {
enable = true;
greeter.enable = false;
autoLogin.enable = true;
autoLogin.user = "xxxxxx";
};
};
windowManager = {
default = "i3";
i3.enable = true;
i3.package = pkgs.i3-gaps;
};
};
};
nix run nixpkgs.nix-info -c nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 5.3.0, NixOS, 19.09beta304.b66fb91f170 (Loris)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3`
- channels(root): `"nixos-19.09beta304.b66fb91f170"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Issue: I can not switch between video card using
xrandr --setprovideroutputsource NVIDIA-0 modesetting
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 35 (RRSetProviderOutputSource)
Value in failed request: 0x28d
Serial number of failed request: 16
Current serial number in output stream: 17
The only option that is working without error is
xrandr --setprovideroutputsource modesetting NVIDIA-0
Note: I can’t see option for Prime Profiles in GUI nvidia-settings
Note: Only option to use Intel VGA is to swithch in configuration.nix between
services.xserver.videoDrivers = [ "intel" ];
services.xserver.videoDrivers = [ "nvidia" ];
and rerun “nixos-rebuild switch” after change every time need to change VGA device.
Is anything missing from my configuration to make change devices work with Optimus via Prime?