NVIDIA: Difference between revisions

imported>Nadimkobeissi
No edit summary
imported>Nadimkobeissi
No edit summary
Line 28: Line 28:
Ensure that the following is in your NixOS configuration file (customizing as you prefer):  
Ensure that the following is in your NixOS configuration file (customizing as you prefer):  


{{warning|If you ae using a laptop, the below configuration update is not sufficient to get your Nvidia card running! Once you've entered it, please continue reading, as there are important adjustments that must then be made to the configuration''' before your laptop graphics will work properly.}}
{{warning|If you are using a laptop, the below configuration update is not sufficient to get your Nvidia card running! Once you've entered it, please continue reading, as there are important adjustments that must then be made to the configuration''' before your laptop graphics will work properly.}}


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 46: Line 46:
   hardware.nvidia = {
   hardware.nvidia = {


     # Modesetting is needed most of the time
     # Modesetting is required.
     modesetting.enable = true;
     modesetting.enable = true;


# Enable power management (do not disable this unless you have a reason to).
    # Enable power management (do not disable this unless you have a reason to).
# Likely to cause problems on laptops and with screen tearing if disabled.
    # Likely to cause problems on laptops and with screen tearing if disabled.
powerManagement.enable = true;
    powerManagement.enable = true;


     # Use the NVidia open source kernel module (not to be confused with the
     # Use the NVidia open source kernel module (not to be confused with the
Line 59: Line 59:
     # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus  
     # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus  
     # Only available from driver 515.43.04+
     # Only available from driver 515.43.04+
    # Do not disable this unless your GPU is unsupported or if you have a good reason to.
     open = true;
     open = true;


Line 119: Line 120:
{
{
hardware.nvidia.prime = {
hardware.nvidia.prime = {
 
# Make sure to use the correct Bus ID values for your system!
# Make sure to use the correct Bus ID values for your system!
intelBusId = "PCI:0:2:0";
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
}
}
Line 148: Line 148:
{
{
hardware.nvidia.prime = {
hardware.nvidia.prime = {
offload = {
offload = {
enable = true;
enable = true;
enableOffloadCmd = true;
enableOffloadCmd = true;
};
};
 
# Make sure to use the correct Bus ID values for your system!
# Make sure to use the correct Bus ID values for your system!
intelBusId = "PCI:0:2:0";
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
}
}
Line 171: Line 170:
     sync.enable = true;
     sync.enable = true;


# Make sure to use the correct Bus ID values for your system!
    # Make sure to use the correct Bus ID values for your system!
     nvidiaBusId = "PCI:1:0:0";
     nvidiaBusId = "PCI:1:0:0";
     intelBusId = "PCI:0:2:0";
     intelBusId = "PCI:0:2:0";
Line 184: Line 183:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{
{
   hardware.nvidia = {
   hardware.nvidia.prime = {
     modesetting.enable = true;
     reverseSync.enable = true;
    # Enable if using an external GPU
    allowExternalGpu = false;


     # Reverse sync is not compatible with the open source kernel module
     # Make sure to use the correct Bus ID values for your system!
    open = false;
    intelBusId = "PCI:0:2:0";
 
    nvidiaBusId = "PCI:1:0:0";
    prime = {
      reverseSync.enable = true;
      # Enable if using an external GPU
      allowExternalGpu = false;
 
  # Make sure to use the correct Bus ID values for your system!
      intelBusId = "PCI:0:2:0";
      nvidiaBusId = "PCI:1:0:0";
    };
   };
   };
}
}