egpu-switcher icon indicating copy to clipboard operation
egpu-switcher copied to clipboard

switch: opensource drivers without monitors should switch to internal

Open hertg opened this issue 2 years ago • 3 comments

If /etc/X11/xorg.conf.d/99-egpu-switcher.conf exists: Expected Behavior: Running sudo egpu-switcher switch auto in the above case of AMD eGPU connected with no displays removes the X11 conf file. Actual Behavior: Running sudo egpu-switcher switch auto in the above case only prints an error, /etc/X11/xorg.conf.d/99-egpu-switcher.conf still exists.

I believe that at line 139 in https://github.com/hertg/egpu-switcher/blob/13b8a0635dfc8c3a894d9040fe0c54367214ec06/cmd/switch.go#L137-L153 should also remove the eGPU file unless the --override is issued. Otherwise the behavior of the switching is inconsistent in this case, as it keeps the file if it previously existed, but doesn't create it if it doesn't exist.

Originally posted by @ewagner12 in https://github.com/hertg/egpu-switcher/issues/106#issuecomment-1501198371

hertg avatar Apr 09 '23 21:04 hertg

Thanks for adding this extra ticket!

One question: If sudo egpu-switcher switch auto running with no monitors connected to the eGPU were removing /etc/X11/xorg.conf.d/99-egpu-switcher.conf then all applications would be rendered by the iGPU instead of the eGPU by default right?

I'm wondering if that's what users would want.

Pro: No USB/Thunderbolt bandwith needed to display the rendered image, its going directly from the iGPU to the eDP, no USB/TB bottleneck. Con: In most cases (when the eGPU is more potent than the iGPU) less rendering power by default.

I'm a bit undecided if that is what I would expect as a user. I think for my case I would slightly tend for the eGPU to be configured as the primary GPU for applications, even if no display is connected. Because why would I otherwise physically connect the eGPU in the first place?

And I would then expect that display managers like LightDM and window managers to enable and use all available monitors by default.


Edit: Saw @ewagner12 's comment here only now, somehow missed it before. Then I'm wondering if it would make sense for the egpu-switcher to indeed remove /etc/X11/xorg.conf.d/99-egpu-switcher.conf if there is no monitor connected to the eGPU - but maybe egpu-switcher could then set DRI_PRIME=1? Still need test this option myself though :-).

T-X avatar Apr 17 '23 19:04 T-X

That's correct, applications would default to using the iGPU unless they use the DRI_PRIME enviroment variable or the PrefersNonDefaultGPU desktop entry or some other way of telling the system that they prefer to use the eGPU. I think one of those options is the preferred way for using the eGPU on the internal display with open source drivers rather than using the xorg configuration.

ewagner12 avatar Apr 17 '23 19:04 ewagner12

One question: If sudo egpu-switcher switch auto running with no monitors connected to the eGPU were removing /etc/X11/xorg.conf.d/99-egpu-switcher.conf then all applications would be rendered by the iGPU instead of the eGPU by default right?

I'm wondering if that's what users would want.

I think we can make the --override flag work for the auto switch, then you could use sudo egpu-switcher switch auto --override to get the behavior you'd want right?

hertg avatar Apr 18 '23 07:04 hertg