NVIDIA: Difference between revisions
m change sub sections to heading 2 , it was a cheeky little mistake |
Player131007 (talk | contribs) Use the new BusId format in nixpkgs |
||
| (One intermediate revision by the same user not shown) | |||
| Line 63: | Line 63: | ||
==== Common setup ==== | ==== Common setup ==== | ||
All PRIME configurations require setting the PCI bus IDs of the two GPUs. One easy way to do find their IDs is by running <code>lspci</code> from the <code>pciutils</code> package, and then finding devices that are classified as VGA controllers. After double checking that the listed devices are indeed your integrated and dedicated GPUs, you can then find the PCI IDs at the beginning of each line. Exact results may vary, but an example output might look like:<syntaxhighlight lang="console"> | All PRIME configurations require setting the PCI bus IDs of the two GPUs. One easy way to do find their IDs is by running <code>lspci</code> from the <code>pciutils</code> package, and then finding devices that are classified as VGA controllers. After double checking that the listed devices are indeed your integrated and dedicated GPUs, you can then find the PCI IDs at the beginning of each line. Exact results may vary, but an example output might look like:<syntaxhighlight lang="console"> | ||
$ nix shell nixpkgs#pciutils -c lspci -d ::03xx | $ nix shell nixpkgs#pciutils -c lspci -D -d ::03xx | ||
0000:00:02.0 VGA compatible controller: Intel Corporation TigerLake-H GT1 [UHD Graphics] (rev 01) | 0000:00:02.0 VGA compatible controller: Intel Corporation TigerLake-H GT1 [UHD Graphics] (rev 01) | ||
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1) | 0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1) | ||
</syntaxhighlight>Before putting them into your configuration, however, '''they must first be reformatted''' — | </syntaxhighlight>Before putting them into your configuration, however, '''they must first be reformatted''' — assuming the bus address is <code><domain>:<bus>:<device>.<func></code>, convert all numbers from hexadecimal to decimal, then the formatted string is <code>PCI:<bus>@<domain>:<device>:<func></code>. They can be set under <code>intelBusId</code>, <code>nvidiaBusId</code>, or <code>amdgpuBusId</code> in <code>hardware.nvidia.prime</code>, depending on the manufacturer of the GPU:{{file|configuration.nix|nix|<nowiki> | ||
{ | { | ||
hardware.nvidia.prime = { | hardware.nvidia.prime = { | ||
intelBusId = "PCI:0:2:0"; | intelBusId = "PCI:0@0:2:0"; | ||
nvidiaBusId = "PCI:1:0:0"; | nvidiaBusId = "PCI:1@0:0:0"; | ||
#amdgpuBusId = "PCI: | # amdgpuBusId = "PCI:5@0:0:0"; # If you have an AMD iGPU | ||
}; | }; | ||
} | } | ||
| Line 95: | Line 95: | ||
offload.enable = true; | offload.enable = true; | ||
intelBusId = "PCI:0:2:0"; | intelBusId = "PCI:0@0:2:0"; | ||
nvidiaBusId = "PCI:1:0:0"; | nvidiaBusId = "PCI:1@0:0:0"; | ||
#amdgpuBusId = "PCI: | # amdgpuBusId = "PCI:5@0:0:0"; # If you have an AMD iGPU | ||
}; | }; | ||
} | } | ||
| Line 118: | Line 118: | ||
sync.enable = true; | sync.enable = true; | ||
intelBusId = "PCI:0:2:0"; | intelBusId = "PCI:0@0:2:0"; | ||
nvidiaBusId = "PCI:1:0:0"; | nvidiaBusId = "PCI:1@0:0:0"; | ||
#amdgpuBusId = "PCI: | # amdgpuBusId = "PCI:5@0:0:0"; # If you have an AMD iGPU | ||
}; | }; | ||
} | } | ||
| Line 135: | Line 135: | ||
reverseSync.enable = true; | reverseSync.enable = true; | ||
intelBusId = "PCI:0:2:0"; | intelBusId = "PCI:0@0:2:0"; | ||
nvidiaBusId = "PCI:1:0:0"; | nvidiaBusId = "PCI:1@0:0:0"; | ||
#amdgpuBusId = "PCI: | # amdgpuBusId = "PCI:5@0:0:0"; # If you have an AMD iGPU | ||
}; | }; | ||
} | } | ||