NVIDIA: Difference between revisions
imported>User m sync mode |
imported>User m offload mode |
||
Line 89: | Line 89: | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
==== offload mode ==== | |||
Recent solution by nvidia. In this mode nvidia card is only activated on demand when you run program with following environment variables set <syntaxHighlight lang="nix">__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME="nvidia" __VK_LAYER_NV_optimus="NVIDIA_only"</syntaxHighlight> | |||
An example of a final configuration is below | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ | |||
services.xserver.videoDrivers = [ "intel" "nvidia" ]; | |||
hardware.nvidia.prime.offload.enable = true; | |||
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA | |||
hardware.nvidia.prime.nvidiaBusId = "PCI:1:0:0"; | |||
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA | |||
hardware.nvidia.prime.intelBusId = "PCI:0:2:0"; | |||
} | |||
</nowiki>}} | |||
== non-NixOS case == | == non-NixOS case == | ||