Nvidia: Difference between revisions

imported>Vodkabot
No edit summary
imported>Vodkabot
No edit summary
Line 14: Line 14:
Use the [https://github.com/dukzcry/crap/tree/master/primerun special script] for out of box experience.
Use the [https://github.com/dukzcry/crap/tree/master/primerun special script] for out of box experience.


Configure NixOS to allow Intel and Nvidia X.Org coexist together, and also to disable nvidia card by default. Requires NixOS version with https://github.com/NixOS/nixpkgs/pull/37369 merged
Configure NixOS to allow Intel and Nvidia X.Org drivers coexist together, and also to disable nvidia card by default. Requires NixOS version with https://github.com/NixOS/nixpkgs/pull/37369 merged
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
let
let
Line 22: Line 22:
in
in
{
{
   hardware.nvidiaOptimus.disable = true; # disable card with bbswitch by default
  # disable card with bbswitch by default
   boot.extraModulePackages = [ nvidia.bin ]; # load kernel modules
   hardware.nvidiaOptimus.disable = true;
   # install these in parallel with intel
  # load kernel modules
   boot.extraModulePackages = [ nvidia.bin ];
   # install nvidia drivers in addition to intel one
   hardware.opengl.extraPackages = [ nvidia.out ];
   hardware.opengl.extraPackages = [ nvidia.out ];
   hardware.opengl.extraPackages32 = [ nvidia32.out ];
   hardware.opengl.extraPackages32 = [ nvidia32.out ];
Line 32: Line 34:
Similar to Bumblebee, start the game via ''primerun.sh''.  
Similar to Bumblebee, start the game via ''primerun.sh''.  


Pros: better performance, Vulkan and Wayland-only setups are supported. CUDA and OpenCL should work, though CUDA needs additional device creation rule https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/nvidia.nix#L66
Pros: better performance, Vulkan is supported. CUDA and OpenCL should work, though CUDA needs an additional device creation rule https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/hardware/video/nvidia.nix#L66


Cons: there are still some rough edges noted on the top of script, but otherwise it works fine for me.
Cons: there are still some rough edges noted on the top of script, but otherwise it works fine for me.