System specs:
- CPU:Intel Core i7-7820HQ
- Laptop : 2017 Dell Precision 5520
- RAM: 16 GB (2x8 GB) 2400MHz
- iGPU: Intel® HD Graphics 630 0.35-1.1 GHz
- dGPU: NVIDIA GM107GLM [Quadro M1200 Mobile]
- OS: Manjaro 18 with KDE 5.14.4 with Kernel 4.19.x/4.20.x
- External display: Dell 27 inch 4K
- Thunderbolt port has only 2 PCIe lanes assigned (Major bottleneck)
- Akitio Node NODE-T3IA-AKTU
- nVidia GeForce GTX 1070 8 GB
- Small Thunderbolt 3 cable
- eGPU to External Dell 4K Monitor connection through Display Port
1) Install and configure Manjaro Linux. In my case its Manjaro 18 KDE version with kernel 4.19+
2) Install the Nvidia-Prime driver (No Bumblebee please) for the Nvidia Quadro M1200 following the steps from here
3) Connect in the eGPU and check if its detected. (For some laptops, Thunderbolt devices should be authorized. I changed by Thunderbolt settings to make sure it was in Secure Mode in the BIOS. Once the Secure Mode has been set in the BIOS, Manjaro automagically detected it)
Section "ServerLayout" Identifier "egpu" Screen 0 "nvidiaegpu" Inactive "intel" EndSection Section "ServerLayout" Identifier "laptop" Screen 0 "intel" Inactive "nvidiaegpu" EndSection Section "Device" Identifier "nvidiaegpu" Driver "nvidia" BusID "PCI:11:0:0" #BusID in decimal, convert from hex Option "AllowEmptyInitialConfiguration" Option "AllowExternalGpus" Option "RegistryDwords" "PerfLevelSrc=0x2222" EndSection Section "Screen" Identifier "nvidiaegpu" Device "nvidiaegpu" Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On}" Option "TripleBuffer" "on" Option "AllowIndirectGLXProtocol" "off" Option "Coolbits" "4" EndSection Section "Device" Identifier "intel" Driver "modesetting" BusID "PCI:0:2:0" EndSection Section "Screen" Identifier "intel" Device "intel" EndSection
(Note that the Bus ID of the eGPU GTX 1070 now is PCI:11:0:0 (which is the decimal equivalent of 0b:00.0 from the earlier step 3)
The above file defines 2 devices, the first 'nvidiaegpu' being the GTX 1070 eGPU and the second 'intel' being the Intel iGPU. 2 Server Layouts are defined, each to use the eGPU or iGPU. Next steps would be to switch between them during boot based on if the eGPU is connected or not.
5) Now, I followed Step 4 from nu_ninja's Build guide , but also tweaked it for Arch based systems.
a) Create a directory called inactive in /etc/X11/xorg.conf.d/ and create a file called 01-laptop.conf
Section "ServerFlags"
Option "DefaultServerLayout" "laptop"
EndSection
b) Create a script to automatically switch to eGPU GTX 1070 or Intel iGPU when the eGPU is connected or not. This can be done by creating the following script /usr/bin/gpuswitch.sh
#!/bin/sh
#Script should be safe as long as DIR and FILE don't point to anything valuable
DIR=/etc/X11/xorg.conf.d
FILE=01-laptop.conf
TEST=$(lspci | grep -c " VGA ")
#Check TEST against number of gpus including egpu
if ([ $TEST -eq 2 ]); then
#eGPU Connected
echo "eGPU Connected, removing laptop config"
if ([ -e $DIR/$FILE ]); then
rm $DIR/$FILE
fi
else
#No eGPU or unexpected number/output
echo "No eGPU found, switching to laptop graphics"
if ([ -e $DIR/$FILE ]); then
break
else
if ([ -e $DIR/inactive/$FILE ]); then
cp $DIR/inactive/$FILE $DIR/$FILE
fi
fi
fi
c) Create a service that triggers this gpu Switch script at startup. Create a file /etc/systemd/system/gpuswitch.service
[Unit]
Description=Script to detect and switch between Integrated Graphics and External GPU
[Service]
ExecStart=/usr/bin/gpuswitch.sh
[Install]
WantedBy=multi-user.target
d) Provide appropriate execution rights for the GPU switch service to run smoothly
sudo chmod 755 /usr/bin/gpuswitch.sh sudo systemctl enable gpuswitch.service
6) Restart and enjoy
1) Youtube 4K60 videos using VP9 codec play ultra smoothly with ~1% frame drops in the new eGPU GTX 1070 configuration, while Quadro M1200 used to drop 50-60% of the frames.
2) FishGl would struggle to hit 10-12 fps when the the fish count is above 100 when using the Quadro M1200, while consistently hits 55+ fps when the fish count is 400 on the eGPU.
3) Unigine Heaven Score on Quadro M1200 : 428
Unigine Heaven Score on eGPU GTX 1070 is 1914.
- Was unable to get the Quadro M1200 working in Laptop mode , when the eGPU 1070 is disconnected. As of now, in laptop mode the Intel iGPU is being used. Will update the above configuration once I get that working.
- KDE's KWin Compositing was dropping frames heavily and I was experiencing lots of input lag on the eGPU 1070, while everything was smooth on the Quadro M1200 and the Intel iGPU, even on the same NVidia driver. The silver bullet to fix this issue turned out to be setting ‘export KWIN_COMPOSE=O2ES’ in /etc/profile.d/kwin.sh during KDE startup.
- Bumblebee never worked for me, even with Intel iGPU and Quadro M1200 dGPU. So, I always used Prime. So, never bothered to test this eGPU stuff with Bumblebee