eGPU setup - completely disable laptop internal monitor and iGPU

I’ve been tinkering a lot with NixOS and I’ve almost completely switched over from Gentoo, but I’m still trying to achieve things with NixOS that I haven’t tried on Gentoo.

I have an eGPU setup with a Framework laptop with an AMD CPU. I’m using specialisations to distinguish between laptop-only and eGPU-at-home usage. For my eGPU specialisation I want to completely disable the iGPU and internal monitor, and only use the eGPU.

I’ve managed to make Plymouth work and show the LUKS password prompt on the eGPU-connected monitors, and I’ve made everything else display on the eGPU monitors.

I’m passing module_blacklist=amdgpu to the kernel cmdline and it seems to be working (outside of Plymouth still displaying on the internal screen before switching to the eGPU screens.

The issue I’m facing is that the internal monitor is always turned on, but doesn’t display anything. Even if the laptop is fully closed and I’m using it in clamshell mode, the screen is still on.

Is there a way to completely disable the internal screen when using the eGPU specialisation? I think the problem arises from the fact that the amdgpu kernel module is disabled and there’s no way to manage the screens connected to the iGPU, but I wonder if there’s a way to disable that screen entirely.

1 Like

After wasting hours tinkering with kernel parameters, I have come to the conclusion that what I want to do is impossible.

When blacklisting the module, I essentially remove the ability for anything, even DPMS, to control the internal screen and since it was turned on by the UEFI to display the boot entries, it’s kept on and blank forever. I’m also using Plymouth which might be interfering, but it is not the main cause of the issue.

The kernel parameters I’m setting are the following:

plymouth.use-simpledrm=0
module_blacklist=amdgpu
modprobe.blacklist=amdgpu,radeon # although unnecessary because of module_blacklist
amdgpu.dc=0
amdgpu.runpm=0
initcall_blacklist=simpledrm_platform_driver_init

I even tried all of the following, but they did nothing:

video=efifb:d
video=vesafb:d
video=eDP:d
video=eDP-1:d
video=LVDS-1:d
video=Unknown-1:d
acpi_backlight=native
acpi_backlight=vendor
acpi_osi=!Windows2015
video.use_native_backlight=1
fbcon=map:0

The only solution was to not disable amdgpu at all, but then the Wayland performance is utter garbage on the eGPU due to how Wayland works. all-ways-egpu kind of solves this issue, but I haven’t tried it on NixOS yet, and I don’t see the point if I can declare everything it does in my config.

I’m still hoping someone will come up with a genius way to disable the internal screen along with the amdgpu module, but at this point I’ve given up on the idea ;/

I think that might be worth investigating, I don’t see anything about “how wayland works” that should logically lead to this.

You haven’t set those things in your config afaict The compositor variable solution is pretty simple; I have code here that does it for all the various compositors (after this udev rule, but you can skip it if you just hard-code your egpu’s pci ID).

Thank you very much for the proposal!

This is the exact same behavior I get on all Linux distributions on Wayland by default. I think it first tries to render everything on the iGPU, then it switches to the eGPU, but it’s offloading (is this the right term though?) instead of actually using the eGPU as primary.


I had some free time and decided to compare Fedora 43 to NixOS and by default it behaved the same, but using all-ways-egpu and its options 2 and 3 it magically made everything super smooth and the performance was as it should be.

The only environment variables I saw were KWIN_DRM_DEVICES and WLR_DRM_DEVICES. This is on par with what you recommend.

I will definitely test this in the coming days when I have more free time to tinker with NixOS again. Thank you very much for the incredible help!

Note that gnome-based compositors instead use that udev rule I have in there as well. I dug through the source of the various compositors to figure out how to configure this :stuck_out_tongue:

I suspect you end up rendering on the iGPU 100% of the time. nvidia-smi should be able to tell you what processes run where (assuming nvidia anyway). My modules there also contain code for managing offload with wayland if you want to try that.

That said, yeah, offload performance with an eGPU won’t be quite as good as with an internal dGPU, since those setups typically don’t have have the fancy multiplexing or memory sharing with the CPU your typical offload scenario has.

It shouldn’t be atrocious, though; the memory needs to make it to and fro the cable anyway, as well as go through your iGPU, at least for internal display rendering. The raw power of the eGPU should largely overcome that.

Yeah, I understand how eGPUs work and I’ve had this setup since 2018 and I’ve changed GPUs and laptops throughout the years.

Sadly, Wayland has always been an issue and now is no exception. I tried setting the *_DRM_DEVICES env vars, but they didn’t help at all - no matter how I ordered the devices. Ultimately, only all-ways-egpu is a solution on Wayland and that’s about it. It does a lot of magic by setting boot_vga and some other stuff under the hood which is basically what enables the proper performance and rendering everything on the eGPU.

And I’ve tested KDE, Gnome, Hyprland, Niri. All of them behave the exact same way, so it’s just Wayland being Wayland.

On X11 I don’t have such issues because I just enable the eGPU in my Xorg config, and X11 renders the eGPUs monitors on the eGPU.

Anyways, thank you very much for the input. I’ll figure out what I’ll do and whether I’ll fully switch to NixOS as my daily.