Discussion:
Is there a way to make xorg-server to release eGPU?
Qu Wenruo
2018-11-18 06:34:02 UTC
Permalink
Hi,

Recently I got a eGPU closure which contains an RX580.

Xorg server detects it and PRIME works mostly fine.

However amdgpu kernel module keeps panicing the whole kernel when the
eGPU is disconnected, either hot plugged out or using the pci remove
sysfs interface.

And rmmod amdgpu returns EBUSY.
So this means I can only hot plug-in, but not hot plug-out.

I'm wondering is there anyway to make xorg-server to release amdgpu
usage and then unload the kernel module before hot plug out or pci remove.

The related kernel is 4.19.1-ARCH, and 1.20.3 xorg-server.

Thanks,
Qu
Michel Dänzer
2018-11-19 11:40:31 UTC
Permalink
Post by Qu Wenruo
Hi,
Recently I got a eGPU closure which contains an RX580.
Xorg server detects it and PRIME works mostly fine.
However amdgpu kernel module keeps panicing the whole kernel when the
eGPU is disconnected, either hot plugged out or using the pci remove
sysfs interface.
And rmmod amdgpu returns EBUSY.
So this means I can only hot plug-in, but not hot plug-out.
I'm wondering is there anyway to make xorg-server to release amdgpu
usage and then unload the kernel module before hot plug out or pci remove.
If you want to use displays connected to the eGPU, you're out of luck.
Once Xorg has initialized a driver for a GPU, there's no way to unload
it until Xorg shuts down.

Otherwise, you can prevent Xorg from using the eGPU directly via

Section "ServerFlags"
Option "AutoAddGPU" "off"
EndSection

in /etc/X11/xorg.conf . Render offloading with DRI_PRIME still works via
DRI3.
--
Earthling Michel DÀnzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
Qu Wenruo
2018-11-19 12:15:56 UTC
Permalink
Post by Michel Dänzer
Post by Qu Wenruo
Hi,
Recently I got a eGPU closure which contains an RX580.
Xorg server detects it and PRIME works mostly fine.
However amdgpu kernel module keeps panicing the whole kernel when the
eGPU is disconnected, either hot plugged out or using the pci remove
sysfs interface.
And rmmod amdgpu returns EBUSY.
So this means I can only hot plug-in, but not hot plug-out.
I'm wondering is there anyway to make xorg-server to release amdgpu
usage and then unload the kernel module before hot plug out or pci remove.
If you want to use displays connected to the eGPU, you're out of luck.
Once Xorg has initialized a driver for a GPU, there's no way to unload
it until Xorg shuts down.
That won't be a problem.

For that usage, I could happily start another X instance for displays
connected to EGPU.
Post by Michel Dänzer
Otherwise, you can prevent Xorg from using the eGPU directly via
Section "ServerFlags"
Option "AutoAddGPU" "off"
EndSection
in /etc/X11/xorg.conf . Render offloading with DRI_PRIME still works via
DRI3.
In that case, do I need some extra steps to enable/disable PRIME?

Thanks,
Qu
Michel Dänzer
2018-11-19 15:25:50 UTC
Permalink
Post by Qu Wenruo
Post by Michel Dänzer
Otherwise, you can prevent Xorg from using the eGPU directly via
Section "ServerFlags"
Option "AutoAddGPU" "off"
EndSection
in /etc/X11/xorg.conf . Render offloading with DRI_PRIME still works via
DRI3.
In that case, do I need some extra steps to enable/disable PRIME?
Not really, just DRI3 needs to be enabled for the primary GPU's driver.
--
Earthling Michel DÀnzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
Dave Airlie
2018-11-19 18:07:45 UTC
Permalink
Post by Michel Dänzer
Post by Qu Wenruo
Hi,
Recently I got a eGPU closure which contains an RX580.
Xorg server detects it and PRIME works mostly fine.
However amdgpu kernel module keeps panicing the whole kernel when the
eGPU is disconnected, either hot plugged out or using the pci remove
sysfs interface.
And rmmod amdgpu returns EBUSY.
So this means I can only hot plug-in, but not hot plug-out.
I'm wondering is there anyway to make xorg-server to release amdgpu
usage and then unload the kernel module before hot plug out or pci remove.
If you want to use displays connected to the eGPU, you're out of luck.
Once Xorg has initialized a driver for a GPU, there's no way to unload
it until Xorg shuts down.
USB hotplug works fine, you can remove things all day, it shouldn't be
hard to make PCI hotplug work.

though I seem to remember some problem around cursor privates making it hard.

Dave.
_______________________________________________
***@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address:

Loading...