mandarin: switched to amd gpu

This commit is contained in:
Aly Raffauf 2024-06-15 17:47:22 -04:00
parent db6d934824
commit 32a9eef8d3
3 changed files with 15 additions and 16 deletions

View file

@ -27,7 +27,7 @@
base = { base = {
enable = true; enable = true;
plymouth.enable = true; plymouth.enable = true;
zramSwap = {enable = true;}; zramSwap.enable = true;
}; };
users = { users = {
aly = { aly = {
@ -63,7 +63,7 @@
flatpak.enable = true; flatpak.enable = true;
ollama = { ollama = {
enable = true; enable = true;
gpu = "nvidia"; gpu = "rocm";
}; };
tailscale.enable = true; tailscale.enable = true;
}; };

View file

@ -11,6 +11,8 @@
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-pc-ssd
]; ];
boot = { boot = {
@ -22,9 +24,9 @@
"usbhid" "usbhid"
"xhci_pci" "xhci_pci"
]; ];
kernelModules = []; kernelModules = ["amdgpu"];
}; };
kernelModules = ["kvm-amd"]; kernelModules = ["kvm-amd" "amdgpu"];
}; };
hardware = { hardware = {
@ -33,19 +35,16 @@
enableAllFirmware = true; enableAllFirmware = true;
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
opengl = { opengl = {
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
extraPackages = with pkgs; [rocmPackages.clr.icd amdvlk];
extraPackages32 = with pkgs; [driversi686Linux.amdvlk];
}; };
}; };
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = ["amdgpu"];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;

View file

@ -15,16 +15,12 @@
boot = { boot = {
initrd = { initrd = {
availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
kernelModules = []; kernelModules = ["amdgpu"];
}; };
kernelModules = ["kvm-amd" "amdgpu"]; kernelModules = ["kvm-amd" "amdgpu"];
}; };
services.xserver = {
videoDrivers = ["amdgpu"]; # Add AMDGPU driver.
};
hardware = { hardware = {
cpu.amd.updateMicrocode = cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware; lib.mkDefault config.hardware.enableRedistributableFirmware;
@ -70,6 +66,10 @@
} }
]; ];
services.xserver = {
videoDrivers = ["amdgpu"]; # Add AMDGPU driver.
};
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";