Talk:NVIDIA: Difference between revisions

imported>Akiross
tip: unsetting CUDA_HOME worked for me in addition to the script listed
imported>Cassandracomar
add reverse prime notes. will update the main page once I've tested hotplugging and fixed some issues with startup.
Line 61: Line 61:
I couldn't make this work successfully until I {{ic|unset CUDA_HOME}}: that was conflicting with {{ic|CUDA_PATH}} and making CUDA devices undiscoverable.
I couldn't make this work successfully until I {{ic|unset CUDA_HOME}}: that was conflicting with {{ic|CUDA_PATH}} and making CUDA devices undiscoverable.
--[[User:Akiross|Akiross]] ([[User talk:Akiross|talk]]) 16:08, 11 February 2021 (UTC)
--[[User:Akiross|Akiross]] ([[User talk:Akiross|talk]]) 16:08, 11 February 2021 (UTC)
----------
reverse PRIME with an integrated amdgpu and discrete nvidia card is working as of nvidia driver version 470 beta, with improved functionality in 495. it should work similarly for an intel integrated device.
{{file|configuration.nix|nix|<nowiki>
{ config, pkgs, ... }:
{
  # do not include "amdgpu" here or the nvidia driver will not get loaded correctly.
  services.xserver.videoDrivers = [ "nvidia" ]; 
 
  hardware.nvidia = {
    # this will work on the 470 stable driver as well but I had issues getting the
    # external monitors to be recognized unless I made sure the monitors were already
    # on during the nvidia driver's initialization.
    # see: https://github.com/NixOS/nixpkgs/pull/141685 for the 495 beta driver.
    package = config.boot.kernelPackages.nvidiaPackages.beta;
 
    # make sure power management is on so the card doesn't stay on when displays
    # (and presumably power) aren't connected.
    powerManagement = {
        enabled = true;
       
        # note: this option doesn't currently do the right thing when you have a pre-Ampere card.
        # if you do, add "nvidia.NVreg_DynamicPowerManagement=0x02" to your kernelParams.
        # for Ampere and newer cards, this option is on by default.
        finegrained = true;
    };
    # ensure the kernel doesn't tear down the card/driver prior to X startup due to the card powering down.
    nvidiaPersistenced = true;
   
    # the following is required for amdgpu/nvidia pairings.
    modesetting.enable = true;
    prime = {
      offload.enable = true;
      # Bus ID of the AMD GPU. You can find it using lspci, either under 3D or VGA
      amdgpuBusId = "PCI:5:0:0";
      # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
      nvidiaBusId = "PCI:1:0:0";
    };
  };
}
</nowiki>}}
Return to "NVIDIA" page.