[Hardware] Add good intel support and basic nvidia support

This commit is contained in:
Antoine Viallon 2022-01-25 12:08:10 +01:00
parent 7c6198be6f
commit 6322c89fb6
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
4 changed files with 44 additions and 13 deletions

View file

@ -14,9 +14,10 @@ in
};
};
# imports = [
# (if (cfg.gpuVendor == "amd") then ./hardware/amd.nix else "")
# (if (cfg.gpuVendor == "nvidia") then ./hardware/nvidia.nix else "")
# (if (cfg.gpuVendor == "intel") then ./hardware/intel.nix else "")
# ];
imports = [
./hardware/amd.nix
./hardware/nvidia.nix
./hardware/intel.nix
];
}

View file

@ -1,8 +1,22 @@
{ config, pkgs, lib, ... }:
with lib;
let
inherit (cfg);
hardwareCfg = config.aviallon.hardware;
in
{
boot.initrd.kernelModules = [ "amdgpu" ];
config = mkIf (hardwareCfg.gpuVendor == "amd") {
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelParams = concatLists [
# for Southern Islands (SI ie. GCN 1) cards
[ "radeon.si_support=0" "amdgpu.si_support=1" ]
# for Sea Islands (CIK ie. GCN 2) cards
[ "radeon.cik_support=0" "amdgpu.cik_support=1" ]
];
hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
rocm-opencl-runtime
];
};
}

View file

@ -1,8 +1,22 @@
{ config, pkgs, lib, ... }:
with lib;
#let
# inherit (cfg);
#in
let
hardwareCfg = config.aviallon.hardware;
in
{
boot.initrd.kernelModules = [ "i915" ];
config = mkIf (hardwareCfg.gpuVendor == "intel") {
boot.initrd.kernelModules = [ "i915" ];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
# intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
intel-graphics-compiler
intel-compute-runtime
];
};
};
}

View file

@ -1,8 +1,10 @@
{ config, pkgs, lib, ... }:
with lib;
let
inherit (cfg);
hardwareCfg = config.aviallon.hardware;
in
{
boot.initrd.kernelModules = [ "nouveau" ];
config = mkIf (hardwareCfg.gpuVendor == "nvidia") {
boot.initrd.kernelModules = [ "nouveau" ];
};
}