eGPU on Linux - Easy-to-use setup script
Did using the Nvidia 418 driver resolve any of your issues?
Thanks for the feedback, i think there's a bug in my script where i detect if the egpu is connected (It probably doesn't understand the Bus-ID "PCI:10:0:0").
Will try to fix that soon, when i've got time. With that bug, the automatic detection probably won't work on your system.
I added this thread to the Top Nav Menu just now.
I added this thread to the Top Nav Menu just now.
This is great! Thank you.
Perhaps, if we do some changes, I would suggest to alter this guide at little. For me it looks a little bit too complicated and meanwhile outdated. This may be just my opinion. Perhaps somebody else shares this opinion, too? @mac_editor?
I just released version 0.9.0, you can update with the following command.
I fixed the issue where EGPUs on double digit PCI-Lanes weren't detected properly.
Also added a little 5s delay for the detection on startup. I realized that the script somehow ran before the EGPU could even connect to the computer, i hope that doesn't happen anymore.
My sincere compliments! Great work.
This is really fantastic, thank you!
I've taken some of the other scripts that have been posted here and modified them with some extra features. One thing that I found really useful was affecting the /usr/share/vulkan/icd.d files (used by vulkan applications).
My problem is that I have a Dell XPS 9575. This system has an Intel iGPU, a dedicated AMD GPU (Vega M) and then when I have my eGPU enabled (Nvidia RTX 2070) I have the following files in that directory:
And many vulkan applications (think games running via DXVK) don't allow you to manually select which vulkan icd to use. Lutris now has this feature, but for those of you that want to guarantee that a specific GPU is used, the best approach is to move the other files to another temporary directory. In my case I move them to a directory called /usr/share/vulkan/icd.d/egpu-helper-backup
If I don't do this most applications tend to pic the AMD GPU (which is discrete, but certainly not as fast as my eGPU).
I've integrated this into this script: https://gitlab.com/rstrube/linux_mercury/blob/master/supporting/egpu-helper/egpu-helper
You can see that if the user passes in 'egpu' as a parameter, in addition to doing the xorg symlinking, it also will move any Intel and AMD icd files to a backup directory (and any nivida icd files from the backup directory and back to the main icd.d directory).
Perhaps you could integrate this into the script? I think the complicated part is that the files you move will vary based on an indiviuals setup. For me I move Intel and AMD icd files when running my eGPU, but for others this might not be the case. In your case you have two nividia GPUs (the laptop's discrete and the eGPU one), so you would need to keep the icd file for nvidia and just move the Intel one (I believe, although I'm not sure?).
I'd also be happy to try to come up with a nice solution and open a PR.
Let me know your thoughts!
Edit: One other thing I was curious about, when the eGPU is not connected, you're specifically use an xorg.conf.internal file that would use (for example) the "intel" driver, and modsetting for the other GPUs (if you picked the Intel iGPU as your INTERNAL GPU). I believe it's now recommended to just use modesetting for Intel iGPUs. See this except from the Arch wiki:
Note: Some (Debian & Ubuntu, Fedora, KDE) recommend not installing the driver, and instead falling back on the modesetting driver for fourth generation and newer GPUs. See , , Xorg#Installation, and . However, the modesetting driver can cause problems such as Chromium Issue 370022. Also, the modesetting driver will not be benefited by Intel GuC/HuC/DMC firmware.
Perhaps the best course of action would just be to not have any xorg.conf in the event that the user does not have their eGPU connected and let Xorg figure things out?
That sounds really interesting, altough i do not have any experience with vulkan whatsoever.
I would be happy to integrate this, but i need to know if this is a really specific setup you have, or if there are other people with the same kind of setup and use-case.
It's important to me that i can keep the script as generic as possible and most importantly that it stays as simple as possible.
That being said, if we can define how the script detects if the user has a vulkan setup (maybe ask him in the setup process),
and define a generic naming-convention for the files (maybe by adding the bus-id to the filename?) it might really be a useful extension.
Is the setup you have, with the *.json files for your different GPUs, a standard type of setup or did you come up with that?
Does vulkan automatically select a json file from /usr/share/vulkan/icd.d/, no matter what its name is?
Regarding the modesetting config, good point.
As you may have seen, I'm using the same xorg.conf template for the external and the internal GPU, and just replace the driver and bus-id.
Did i understand correctly, that it is recommended for the Intel integrated graphics to not having specified the driver at all, and instead just use the modesetting driver?
Your suggestion to not create an xorg.conf.internal file could be a good idea.
But there may be people that want to add custom xorg configurations when running on the internal GPU, therefore we still need some kind of xorg.conf.internal.
Perhaps we could leave the xorg.conf.internal file empty, if the user selects the Intel integrated graphics as internal GPU.
What are your thoughts about that?
You seem to be well informed about the topic, so thanks alot for the input!