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

[Feature request] Add the possibility to execute some custom commands when switching the gpu configuration

Open Astaoth opened this issue 3 years ago • 0 comments

Hi !

The contexte is the same as issue #72, I still have the same laptop ;)

Context

I have a laptop with an Intel GPU and a Nvidia Quadro. It works fine, if I want to run programs on my nvidia card I can use prime-run, else they will be executed on the Intel GPU.

Now, I would like to use a eGPU. The eGPU is visible from the system even without any xorg configuration. However, when I perform a "DRI_PRIME=1 glxgear", I'll have some libGL errors and the glxgear window will remain black, because the nvidia_drm module is loaded. The solution is to rmmod it, and then programs launched with DRI_PRIME=1 will work fine. However, this rmmod has to be done before Xorg is launched.

Feature request

Would it be possible to add, in the egpu-switcher configuration file, some fields which will have some command to run when switching the GPU profile ? With this, I'll be able, for example, to execute a "echo 'blacklist nvidia_drm' > /etc/modprobe.d/egpu.conf && rmmod nvidia_drm" when switching to the eGPU profile, and a "echo '' > /etc/modprobe.d/egpu.conf" when switching to the internal profile.

Thank you

System informations :

  • Did you install egpu-switcher via ppa or via git + make : egpu-switcher is installed from AUR (so it's kind of git+make)
  • What Linux distribution (+ version) are you using : Archlinux
  • What brand / model is your laptop : Dell precision 7510 with NVidia Quadro
  • What brand / model is your GPU (+ enclosure) : AMD RX580 + Akitio Node
  • What drivers (+ version) are you using : latest amdgpu and nvidia 470
  • What Desktop-Environment do you use (+ Display-Manager) : Xorg with FVWM (no DE)

Astaoth avatar Oct 06 '21 09:10 Astaoth