Setup & Software Discussions
Blacklist i915 for Wayland eGPU
 

Blacklist i915 for Wayland eGPU  

  RSS

nu_ninja
(@nu_ninja)
Estimable Member
Joined: 1 year ago
 

I stumbled across this method of getting full, non-Prime eGPU acceleration, which also works for me in (some) Wayland implementations. Here's how it goes:

Process:

To get eGPU working:
1) Blacklist iGPU module
For Intel integrated graphics this is the module called "i915". I blacklisted it by adding the following to the file /etc/modprobe.d/blacklist.conf

install i915 /bin/false

this ensures the module can't be installed. Note if you have a different type of integrated graphics you could replace the "i915" with whatever module controls your iGPU, however, it can't be the same one that controls your eGPU. For example, "amdgpu" controls all AMD graphics devices so blocking it on a laptop with an AMD APU would also prevent an AMD eGPU from working.

2) Update initramfs image
For the Ubuntu installation I'm testing, this is done with the command:

sudo update-initramfs -u

3) Restart with eGPU connected
Now that the iGPU can't work anymore, the computer should see only the eGPU and its outputs. This means a blank internal display and fully eGPU accelerated external displays.

To return to normal and get the iGPU working again, simply remove the line added to the file /etc/modprobe.d/blacklist.conf then repeat step 2 and restart.

Complications:

If you don't already have automatic login, you will likely be greeted with a black screen after restarting. Auto login was the easiest way I found to get around this issue, though other methods could be used to show the login screen on the external display. Beyond this there were occasional graphics glitches when logging in or starting a new application. Finally, while KDE Plasma (Wayland) worked under this method, I couldn't get the GNOME Wayland desktop working. On attempting to login, the screen would just flash black and return to the login screen.

Overall, I definitely wouldn't choose this method over our current scripts for X11 implementations, however, these scripts obviously only work for X11 and not Wayland. If you really want to use a Wayland desktop, this seems to be a much better method for it than the previous way of simply setting DRI_PRIME=1.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


itsage liked
ReplyQuote
Topic Tags
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 1 year ago
 

A bit of a belated update to this post, but I figured it's worth it at this point.

First off, a much simpler way of blacklisting the intel module is to simply add the following line as a kernel parameter:

module_blacklist=i915,snd_hda_intel

info on how to add kernel parameters here. I might write a script to add a boot option in GRUB/rEFInd with this if there's any interest.

Also, it looks like as of GNOME 3.32 (included in Ubuntu 19.04), both the Gnome desktop as well as the gdm3 login manager are working with this hack for me. This means the Wayland versions of both KDE Plasma and GNOME should have fully eGPU accelerated desktops on an external display. Possibly more importantly, gdm3 can give a proper login screen to use with either of them.

It looks like as Wayland matures, the bugs are being ironed out. However, multi-GPU setups remain an underdeveloped area. To my knowledge, it's the responsibility of a Wayland compositor (Clutter for GNOME, KWin for KDE, etc) to set the primary GPU. While this process seems to be getting better (as the now working Gnome desktop suggests) it seems to be totally automated in both these desktop environments. I believe Sway is one of the few to give an easy user accessible option to change the primary rendering GPU; this is a feature I hope makes it into more desktops in the future.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


ReplyQuote