Enable GPU output for my AMD eGPU
diff --git a/modules/amd.nix b/modules/amd.nix
index 13e88cb..7dbbb6e 100644
--- a/modules/amd.nix
+++ b/modules/amd.nix
@@ -1,12 +1,30 @@
-{ pkgs, ... }: {
+{ pkgs, lib, ... }: {
+ home = {
+ home.file.".config/prelaunch/amd-output-source.sh".text = ''
+ if [[ $(xrandr --listproviders | grep "AMD Radeon RX 6700 XT @ pci:0000:06:00.0") ]]; then
+ xrandr --setprovideroutputsource "AMD Radeon RX 6700 XT @ pci:0000:06:00.0" modesetting
+ fi
+ '';
+ home.file.".config/prelaunch/amd-output-source.sh".executable = true;
+ };
config = {
boot.initrd.kernelModules = [ "radeon" "amdgpu" ];
- services.xserver.videoDrivers = [ "radeon" "amdgpu" "modesetting" "fbdev" ];
+ services.xserver.videoDrivers = [ "amdgpu" "radeon" "modesetting" "fbdev" ];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
services.hardware.bolt.enable = true;
+ services.xserver.config = lib.mkAfter ''
+ Section "Device"
+ Identifier "Device-amdgpu[1]"
+ Driver "amdgpu"
+ BusID "PCI:06:00.0"
+ Option "AllowExternalGpus" "True"
+ Option "AllowEmptyInitialConfiguration"
+ Option "TearFree" "true"
+ EndSection
+ '';
};
}
diff --git a/modules/displays.nix b/modules/displays.nix
index 136c784..425e7da 100644
--- a/modules/displays.nix
+++ b/modules/displays.nix
@@ -1,19 +1,8 @@
{ lib, pkgs, ... }: {
- config = {
- boot.kernelParams = [
- "video=eDP-1:2256x1440@60"
- "video=HDMI-A-1:3840x2160@76"
- ];
- services.xserver.config = lib.mkAfter ''
- Section "Device"
- Identifier "Device-radeon[1]"
- Driver "ati"
- BusID "PCI:06:00.0"
- Option "AllowExternalGpus" "True"
- Option "AllowEmptyInitialConfiguration"
- EndSection
- '';
- };
+ config.boot.kernelParams = [
+ "video=eDP-1:2256x1440@60"
+ "video=HDMI-A-1:3840x2160@76"
+ ];
home = {
services.grobi = {
enable = true;