Nvidia: Difference between revisions

(switch to unstable nixpkgs wiki link)
(Added NVIDIA prime option for AMD GPUs that was missing. Also made it clear that AMD integrated GPUs will also work with NVIDIA prime offload. I added this change to the old wiki too and was copied from there.)
Line 98: Line 98:
=== Configuring Optimus PRIME: bus ID values (mandatory) ===
=== Configuring Optimus PRIME: bus ID values (mandatory) ===


Before we can continue, we must first determine the bus ID values for both your Nvidia and Intel GPUs. This step will be essential regardless of which configuration you later adopt.
Before we can continue, we must first determine the bus ID values for both your Nvidia and Intel and AMD GPUs. This step will be essential regardless of which configuration you later adopt.


First, install the <code>lshw</code> package in order to be able to use the <code>lshw</code> command, then run:
First, install the <code>lshw</code> package in order to be able to use the <code>lshw</code> command, then run:
Line 140: Line 140:
intelBusId = "PCI:0:2:0";
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:14:0:0";
nvidiaBusId = "PCI:14:0:0";
        # amdgpuBusId = "PCI:54:0:0"; For AMD GPU
};
};
}
}
Line 146: Line 147:
=== Optimus PRIME option A: offload mode ===
=== Optimus PRIME option A: offload mode ===


''Offload mode is available in NixOS 20.09 and higher, and requires an Nvidia card of the Turing generation or newer, and an Intel chipset from the Coffee Lake generation or newer.''
''Offload mode is available in NixOS 20.09 and higher, and requires an Nvidia card of the Turing generation or newer, an Intel chipset from the Coffee Lake generation or newer, or an AMD Ryzen CPU like the 5800H .''


Offload mode puts your Nvidia GPU to sleep and lets the Intel GPU handle all tasks, except if you call the Nvidia GPU specifically by "offloading" an application to it. For example, you can run your laptop normally and it will use the energy-efficient Intel GPU all day, and then you can offload a game from Steam onto the Nvidia GPU to make the Nvidia GPU run that game only. For many, this is the most desirable option.
Offload mode puts your Nvidia GPU to sleep and lets the Intel GPU handle all tasks, except if you call the Nvidia GPU specifically by "offloading" an application to it. For example, you can run your laptop normally and it will use the energy-efficient Intel GPU all day, and then you can offload a game from Steam onto the Nvidia GPU to make the Nvidia GPU run that game only. For many, this is the most desirable option.
Line 172: Line 173:
intelBusId = "PCI:0:2:0";
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:14:0:0";
nvidiaBusId = "PCI:14:0:0";
        # amdgpuBusId = "PCI:54:0:0"; For AMD GPU.
};
};
}
}
Line 190: Line 192:
     nvidiaBusId = "PCI:14:0:0";
     nvidiaBusId = "PCI:14:0:0";
     intelBusId = "PCI:0:2:0";
     intelBusId = "PCI:0:2:0";
    # amdgpuBusId = "PCI:54:0:0"; For AMD GPU
   };
   };
}
}
Line 208: Line 211:
     intelBusId = "PCI:0:2:0";
     intelBusId = "PCI:0:2:0";
     nvidiaBusId = "PCI:14:0:0";
     nvidiaBusId = "PCI:14:0:0";
    # amdgpuBusId = "PCI:54:0:0"; For AMD GPU
   };
   };
}
}