Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get my eGPU working #34

Open
GameBurrow opened this issue Dec 7, 2024 · 12 comments
Open

Unable to get my eGPU working #34

GameBurrow opened this issue Dec 7, 2024 · 12 comments

Comments

@GameBurrow
Copy link

GameBurrow commented Dec 7, 2024

Howdy folks, I'm on my every year attempt in trialing out linux. I have Intel iGPU, Nvidia dGPU and Nvidia eGPU (via Thunderbolt3). According to nvidia-smi and lspci (or whatever the last command was to list the hardware), the gpu is detected and driver attached to it.

lspci -k -d ::03xx
00:02.0 Display controller: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] (rev 0c)
    DeviceName: Onboard - Video
    Subsystem: ASUSTeK Computer Inc. Device 1aec
    Kernel driver in use: i915
    Kernel modules: i915, xe
01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [Geforce RTX 3070 Ti Laptop GPU] (rev a1)
    Subsystem: ASUSTeK Computer Inc. Device 1aec
    Kernel driver in use: nvidia
    Kernel modules: nouveau, nvidia_drm, nvidia
06:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3080] (rev a1)
    Subsystem: Gigabyte Technology Co., Ltd Device 405d
    Kernel driver in use: nvidia
    Kernel modules: nouveau, nvidia_drm, nvidia
nvidia-smi
Sat Dec  7 17:19:43 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.77                 Driver Version: 565.77         CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3070 ...    Off |   00000000:01:00.0  On |                  N/A |
| N/A   49C    P0             48W /  139W |    1512MiB /   8192MiB |      3%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 3080        Off |   00000000:06:00.0 Off |                  N/A |
|  0%   24C    P8             11W /  320W |       2MiB /  10240MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

What's the issue is that no monitors connected to it is detected. I also tried all-ways-egpu - tried all 3 methods. Every time it's supposed to be using the egpu, I just get black screen with the _ on top left or computer boot screen on the laptop monitor.

I've tried cachyos (both KDE and GNOME wayland) and even tried with Nobara. All behaved the same. Currently on cachy KDE (wayland). I know when I last trialed linux longer 2y ago (on another laptop), I had a similar issue. Managed to get it working thorugh X11 then but would like to get it working with wayland this time. Any idea what might be the cause?

@ewagner12
Copy link
Owner

The Nvidia eGPU+Nvidia dGPU+iGPU combination seems to be a tricky one for sure. Others have reported issues with this combination as well.
IIRC GNOME still has issues with Intel iGPU when an Nvidia gpu is primary so I'd recommend sticking to KDE.
Have you tried manually reloading the nvidia_drm module as this was found helpful here? hertg/egpu-switcher#117

@GameBurrow
Copy link
Author

GameBurrow commented Dec 8, 2024

The Nvidia eGPU+Nvidia dGPU+iGPU combination seems to be a tricky one for sure. Others have reported issues with this combination as well. IIRC GNOME still has issues with Intel iGPU when an Nvidia gpu is primary so I'd recommend sticking to KDE. Have you tried manually reloading the nvidia_drm module as this was found helpful here? hertg/egpu-switcher#117

Hey, thanks for reply. Thankly KDE is my preferred DE, just tested with GNOME to rule out KDE/SDDM issue.

Thankly my computer has a mux switch (and I can control it with supergfxctl -m Integrated). When I use that and reboot, it seems this laptop is smart enough to completely disable my internal dGPU (it's not listed on fastfetch, lspci -k -d ::03xx nor in nvidia-smi). Sadly that was not enough to make the script to work.

However the manual reloading script you sent me, did push me forward.

Currently this seems to be the process of getting it working:

  1. supergfxctl -m Integrated to switch to internal gpu only
  2. Reboot/start without having egpu connected
  3. Login, attach the egpu
  4. Run the reloading of nvidia-drm script (if I try to run it while my NVidia dGPU is turned on (in Hybrid or dedicated mux switch mode), can't do it since it said it's in use. So I'm not sure if it could work while my Nvidia dGPU is actually enabled also)
  5. In few seconds the screens on egpu show up but they are a laggy (problably kde not using it normally yet)
  6. Now I have to use the method 2 in the all-ways-egpu to enable eGPU
  7. Restart display manager
  8. Now it seems to be using the gpu properly also.

@GameBurrow
Copy link
Author

@ewagner12 Do you think we could somehow automate this so I don't need to go through the process every time I launch my computer

@ewagner12
Copy link
Owner

@GameBurrow I can look into adding a way to automate it, but since I don't have an Nvidia dGPU system I'd have to rely on you to test it to make sure it works as intended

@GameBurrow
Copy link
Author

@GameBurrow I can look into adding a way to automate it, but since I don't have an Nvidia dGPU system I'd have to rely on you to test it to make sure it works as intended

Not an issue ;)

@GameBurrow
Copy link
Author

GameBurrow commented Dec 9, 2024

The Nvidia eGPU+Nvidia dGPU+iGPU combination seems to be a tricky one for sure. Others have reported issues with this combination as well. IIRC GNOME still has issues with Intel iGPU when an Nvidia gpu is primary so I'd recommend sticking to KDE. Have you tried manually reloading the nvidia_drm module as this was found helpful here? hertg/egpu-switcher#117

Hey, thanks for reply. Thankly KDE is my preferred DE, just tested with GNOME to rule out KDE/SDDM issue.

Thankly my computer has a mux switch (and I can control it with supergfxctl -m Integrated). When I use that and reboot, it seems this laptop is smart enough to completely disable my internal dGPU (it's not listed on fastfetch, lspci -k -d ::03xx nor in nvidia-smi). Sadly that was not enough to make the script to work.

However the manual reloading script you sent me, did push me forward.

Currently this seems to be the process of getting it working:

1. `supergfxctl -m Integrated` to switch to internal gpu only

2. Reboot/start **without having egpu connected**

3. Login, attach the egpu

4. Run the reloading of nvidia-drm script (if I try to run it while my NVidia dGPU is turned on (in Hybrid or dedicated mux switch mode), can't do it since it said it's in use. So I'm not sure if it could work while my Nvidia dGPU is actually enabled also)

5. In few seconds the screens on egpu show up but they are a laggy (problably kde not using it normally yet)

6. Now I have to use the method 2 in the all-ways-egpu to enable eGPU

7. Restart display manager

8. Now it seems to be using the gpu properly also.

Small update, it seems that either the eGPU seriously underperforms on linux compared to windows or that method is creating issues.I think the nvidia driver is not properly initialising with this method, because this the script process I have to run atm for things to worke even somewhat:

sudo mv /usr/share/vulkan/icd.d/nvidia_icd.json_inactive /usr/share/vulkan/icd.d/nvidia_icd.json
sudo ~/reloadnvidia.sh
sudo all-ways-egpu set-boot-vga egpu
sudo all-ways-egpu set-compositor-primary egpu
sudo systemctl restart sddm

notice the first comand I have to run (can have it at the end of my script also, doesn't matter when I run it but I need to run it), that according to internet means nvidia driver is properly not loading.

@ewagner12
Copy link
Owner

I added changes to the GitHub repo that added an entry point to the script. The idea is that you can add the custom commands needed for your unique setup before and after the script is run.

You can try installing the latest git version following these steps

Then add the commands you need to the /usr/bin/all-ways-egpu-entry.sh file as mentioned in the Entry Point section in the readme. Those commands will then be executed when the script is called at startup or if all-ways-egpu-entry.sh is run

Unfortunately, I can't help with the other Nvidia driver issues as I don't have any experience with those

@armenmatoosian
Copy link

armenmatoosian commented Dec 13, 2024

I also have an Intel cpu/igpu, nvidia dgpu, and nvidia egpu. I'm using a razer blade 2018-base and a razer core x enclosure. Using method 2, I'm able to get the endeavour os (Wayland) login screen to show up on two of my monitors, while my laptop screen is blank. However, once I login, both monitors go blank and my laptop screen turns on.

I'm hoping I might be able to help with troubleshooting the nvidia dgpu/egpu issue - are there any logs I can share or tests I can do that might provide useful info?

This is the one of the main hurdles preventing me from switching to Linux on my laptop. I've basically replaced windows on my desktop, which outputs directly to a single display.

Lastly, thanks @ewagner12 for all that you've done for those of us stubbornly trying to get our egpus working with Linux!

@GameBurrow
Copy link
Author

I added changes to the GitHub repo that added an entry point to the script. The idea is that you can add the custom commands needed for your unique setup before and after the script is run.

You can try installing the latest git version following these steps

Then add the commands you need to the /usr/bin/all-ways-egpu-entry.sh file as mentioned in the Entry Point section in the readme. Those commands will then be executed when the script is called at startup or if all-ways-egpu-entry.sh is run

Unfortunately, I can't help with the other Nvidia driver issues as I don't have any experience with those

Small update, did the try the script, it resulted in my me being unable to get into the OS at all( couldn't even get to TTY), even when eGPU was disconnecced, problably means it attempted to load the script too early or sth. Will try again at one point when I have to time to fix the the issue of me not getting in (thankly I have that the linux build on my disc for testing only atm).

@ewagner12
Copy link
Owner

@GameBurrow
Ok if you get stuck at boot like that the way to recover is to enter the grub boot menu (or whatever bootloader you're using) and boot to the multi-user.target. The script only triggers for the graphical.target so any other target like multi-user or the recovery option Ubuntu provides should avoid the script and let you login.

@ewagner12
Copy link
Owner

@GameBurrow @armenmatoosian
I just remembered that SDDM (the KDE login screen) defaults to using X rather than wayland and that's been known to cause issues. So for both of you I'd recommend switching it to use wayland instead: https://wiki.archlinux.org/title/SDDM#Wayland
That might work around some login issues you're seeing.

@ewagner12
Copy link
Owner

I added changes to the GitHub repo that added an entry point to the script. The idea is that you can add the custom commands needed for your unique setup before and after the script is run.
You can try installing the latest git version following these steps
Then add the commands you need to the /usr/bin/all-ways-egpu-entry.sh file as mentioned in the Entry Point section in the readme. Those commands will then be executed when the script is called at startup or if all-ways-egpu-entry.sh is run
Unfortunately, I can't help with the other Nvidia driver issues as I don't have any experience with those

Small update, did the try the script, it resulted in my me being unable to get into the OS at all( couldn't even get to TTY), even when eGPU was disconnecced, problably means it attempted to load the script too early or sth. Will try again at one point when I have to time to fix the the issue of me not getting in (thankly I have that the linux build on my disc for testing only atm).

I did some testing with an nvidia eGPU and I think this issue with the git version of the script was caused by reloading the nvidia_drm module. It seems like it resets the parameters needed for Wayland so reloading nvidia_drm should be done with the command:
modprobe -r nvidia_drm && modprobe nvidia_drm modeset=1 fbdev=1
In my testing that seemed to fix the issue so I made that change to the entry point example in the github repo. If you have time to test again you can change your /usr/bin/all-ways-egpu-entry.sh to make sure you're including the modeset=1 and fbdev=1 parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants