eGPU on Linux - Easy-to-use setup script
 
Notifications
Clear all

eGPU on Linux - Easy-to-use setup script  

 of  11
  RSS

LevelPlant
(@levelplant)
New Member
Joined: 1 month ago
 

Hey @hertg,

This worked perfectly on a Lenovo X1 Extreme 2nd Gen running Ubuntu 20.10 with a Razer Core X and Nvidia 2080 ti.

The only change I had to make was to copy my monitors.xml config for gdm3 but that was a breeze and not related to your script. If you're experiencing a crazy screen resolution on your internal or external display in GDM3 than check out: https://superuser.com/questions/1270939/how-can-i-change-gdm-greeter-resolution-debian-9-xwayland-vmware

Some desktop environments store display settings in ~/.config/monitors.xml. xrandr commands are then generated on the base of the file content. GDM has a similar file stored in /var/lib/gdm/.config/monitors.xml.

If you have your monitors setup as you like (orientation, scaling, primary and so on) in ~/.config/monitors.xml and want GDM to honor those settings:

$ sudo cp ~/.config/monitors.xml /var/lib/gdm/.config/ $ sudo chown gdm:gdm /var/lib/gdm/.config/monitors.xml
This post was modified 1 month ago

Lenovo X1 Extreme 2nd Gen, Razer Core X, Ubuntu 20.10


ReplyQuote
SES SPECS
(@ses_specs)
New Member
Joined: 1 week ago
 

Hello to all,

 

Many Thanks Hertg !

For your work and this sharing, this should be directly in ubuntu, it is magical configuration nice to have for eGPU on linux for sure.

 

Tested on Ubuntu 20.04.1 LTS.

I installed the pilot nvidia via ppa :

$ cat /etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-focal.list
deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal main

 

Packages dpkg list :

$ dpkg -l | grep -i nvidia
ii libnvidia-cfg1-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-450 450.80.02-0ubuntu0.20.04.2 all Shared files used by the NVIDIA libraries
ii libnvidia-common-455 455.23.04-0ubuntu0~0.20.04.1 all Shared files used by the NVIDIA libraries
rc libnvidia-compute-450:amd64 450.80.02-0ubuntu0.20.04.2 amd64 NVIDIA libcompute package
ii libnvidia-compute-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA libcompute package
ii libnvidia-compute-455:i386 455.23.04-0ubuntu0~0.20.04.1 i386 NVIDIA libcompute package
ii libnvidia-decode-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-decode-455:i386 455.23.04-0ubuntu0~0.20.04.1 i386 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVENC Video Encoding runtime library
ii libnvidia-encode-455:i386 455.23.04-0ubuntu0~0.20.04.1 i386 NVENC Video Encoding runtime library
ii libnvidia-extra-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-fbc1-455:i386 455.23.04-0ubuntu0~0.20.04.1 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-gl-455:i386 455.23.04-0ubuntu0~0.20.04.1 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-ifr1-455:amd64 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii libnvidia-ifr1-455:i386 455.23.04-0ubuntu0~0.20.04.1 i386 NVIDIA OpenGL-based Inband Frame Readback runtime library
rc nvidia-compute-utils-450 450.80.02-0ubuntu0.20.04.2 amd64 NVIDIA compute utilities
ii nvidia-compute-utils-455 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA compute utilities
rc nvidia-dkms-450 450.80.02-0ubuntu0.20.04.2 amd64 NVIDIA DKMS package
ii nvidia-dkms-455 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA DKMS package
ii nvidia-driver-455 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA driver metapackage
rc nvidia-kernel-common-450 450.80.02-0ubuntu0.20.04.2 amd64 Shared files used with the kernel module
ii nvidia-kernel-common-455 455.23.04-0ubuntu0~0.20.04.1 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-455 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.14 all Tools to enable NVIDIA's Prime
ii nvidia-settings 440.82-0ubuntu0.20.04.1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-455 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA driver support binaries
ii screen-resolution-extra 0.18build1 all Extension for the nvidia-settings control panel
ii xserver-xorg-video-nvidia-455 455.23.04-0ubuntu0~0.20.04.1 amd64 NVIDIA binary Xorg driver

 

 

 

Thunderbolt box :

$ boltctl
● SAPPHIRE TECHNOLOGY LIMITED GearBox
├─ type: peripheral
├─ name: GearBox
├─ vendor: SAPPHIRE TECHNOLOGY LIMITED
├─ uuid: 00ec1945-4590-2e01-ffff-ffffffffffff
├─ status: authorized
│ ├─ domain: bf010000-0072-7088-a07d-61040a43b01e
│ └─ authflags: boot
├─ authorized: ven. 16 oct. 2020 08:25:50
├─ connected: ven. 16 oct. 2020 08:25:50
└─ stored: mer. 14 oct. 2020 19:33:32
├─ policy: auto
└─ key: no

GPU :

Nvidia GeForce RTX 2060

Details :

$ lspci | grep -i VGA
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
09:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 Rev. A] (rev a1)

 

Conf :

T480s + egpu saphire + nvidia geforce RTX2060

  

$ LANG=C lshw -short
WARNING: you should run this program as super-user.
H/W path Device Class Description
====================================================================
system Computer
/0 bus Motherboard
/0/0 memory 8064MiB System memory
/0/1 processor Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
/0/100 bridge Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers
/0/100/2 display UHD Graphics 620
/0/100/4 generic Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
/0/100/8 generic Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model
/0/100/14 bus Sunrise Point-LP USB 3.0 xHCI Controller
/0/100/14.2 generic Sunrise Point-LP Thermal subsystem
/0/100/15 generic Sunrise Point-LP Serial IO I2C Controller #0
/0/100/16 communication Sunrise Point-LP CSME HECI #1
/0/100/1c bridge Sunrise Point-LP PCI Express Root Port #1
/0/100/1c.4 bridge Sunrise Point-LP PCI Express Root Port #5
/0/100/1c.4/0 bridge JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] /0/100/1c.4/0/0 bridge JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] /0/100/1c.4/0/0/0 generic JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] /0/100/1c.4/0/1 bridge JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] /0/100/1c.4/0/1/0 bridge JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] /0/100/1c.4/0/1/0/1 bridge JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] /0/100/1c.4/0/1/0/1/0 display TU106 [GeForce RTX 2060 Rev. A] /0/100/1c.4/0/1/0/1/0.1 multimedia TU106 High Definition Audio Controller
/0/100/1c.4/0/1/0/1/0.2 bus TU106 USB 3.1 Host Controller
/0/100/1c.4/0/1/0/1/0.3 bus TU106 USB Type-C UCSI Controller
/0/100/1c.4/0/1/0/4 bridge JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] /0/100/1c.4/0/1/0/4/0 bus JHL6540 Thunderbolt 3 USB Controller (C step) [Alpine Ridge 4C 2016] /0/100/1c.4/0/2 bridge JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] /0/100/1c.6 bridge Sunrise Point-LP PCI Express Root Port #7
/0/100/1c.6/0 wlp61s0 network Wireless 8265 / 8275
/0/100/1d bridge Sunrise Point-LP PCI Express Root Port #9
/0/100/1d/0 storage NVMe SSD Controller SM981/PM981/PM983
/0/100/1f bridge Sunrise Point LPC Controller/eSPI Controller
/0/100/1f.2 memory Memory controller
/0/100/1f.3 multimedia Sunrise Point-LP HD Audio
/0/100/1f.4 bus Sunrise Point-LP SMBus
/0/100/1f.6 enp0s31f6 network Ethernet Connection (4) I219-V
/0/2 system PnP device PNP0c02
/0/3 system PnP device PNP0c02
/0/4 system PnP device PNP0c02
/0/5 system PnP device PNP0c02
/0/6 system PnP device PNP0b00
/0/7 generic PnP device INT3f0d
/0/8 generic PnP device LEN0071
/0/9 generic PnP device LEN008f
/0/a system PnP device PNP0c02
/0/b system PnP device PNP0c02
/0/c system PnP device PNP0c02
/0/d system PnP device PNP0c01
/1 scsi0 storage
/2 virbr0-nic network Ethernet interface
/3 enxdc9c522257db network Ethernet interface
/4 virbr0 network Ethernet interface

 

Display manager : GDM 3standard

$ systemctl status gdm
● gdm.service - GNOME Display Manager
Loaded: loaded (/lib/systemd/system/gdm.service; static; vendor preset: enabled)
Active: active (running) since Fri 2020-10-16 10:25:54 CEST; 21min ago
Process: 1035 ExecStartPre=/usr/share/gdm/generate-config (code=exited, status=0/SUCCESS)
Process: 1037 ExecStartPre=/usr/lib/gdm3/gdm-wait-for-drm (code=exited, status=0/SUCCESS)
Main PID: 1040 (gdm3)
Tasks: 3 (limit: 9198)
Memory: 7.3M
CGroup: /system.slice/gdm.service
└─1040 /usr/sbin/gdm3

oct. 16 10:25:54 ThinkPad-T480s systemd[1]: Starting GNOME Display Manager...
oct. 16 10:25:54 ThinkPad-T480s systemd[1]: Started GNOME Display Manager.
oct. 16 10:25:54 ThinkPad-T480s gdm-autologin][1125]: gkr-pam: no password is available for user
oct. 16 10:25:54 ThinkPad-T480s gdm-autologin][1125]: pam_unix(gdm-autologin:session): session opened for user sesspecs by (uid=0)
oct. 16 10:25:54 ThinkPad-T480s gdm-autologin][1125]: gkr-pam: gnome-keyring-daemon started properly

 

 

I didn't know this option :

Option "AllowExternalGpus" "True"

 

The output file xorg.conf generated by your script was :

Section "Module"
Load "modesetting"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
BusID "9:0:0"
Option "AllowEmptyInitialConfiguration"
Option "AllowExternalGpus" "True"
EndSection

 

I have now all my drivers settings nvidia via nvidia-settings.

$ glxinfo 
*name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
GLX_ARB_context_flush_control, GLX_ARB_create_context,
GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_multisample, GLX_EXT_buffer_age,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, GLX_EXT_libglvnd,
GLX_EXT_stereo_tree, GLX_EXT_swap_control, GLX_EXT_swap_control_tear,
GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer,
GLX_NV_multigpu_context, GLX_NV_robustness_video_memory_purge,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_swap_control,
GLX_SGI_video_sync
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
GLX_ARB_context_flush_control, GLX_ARB_create_context,
GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_buffer_age,
GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile,
GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB,
GLX_EXT_import_context, GLX_EXT_stereo_tree, GLX_EXT_swap_control,
GLX_EXT_swap_control_tear, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_NV_copy_buffer,
GLX_NV_copy_image, GLX_NV_delay_before_swap, GLX_NV_float_buffer,
GLX_NV_multigpu_context, GLX_NV_multisample_coverage,
GLX_NV_robustness_video_memory_purge, GLX_NV_swap_group,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGI_swap_control,
GLX_SGI_video_sync
GLX version: 1.4

...

And so on...

 

 

My output xrandr :

$ xrandr
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
DVI-D-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 475mm x 267mm
1920x1080 60.00*+
1680x1050 59.95
1600x1200 60.00
1440x900 59.89
1280x1024 60.02
1280x960 60.00
1280x720 60.00
1024x768 60.00
800x600 60.32
640x480 59.94
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
1920x1080 60.01*+ 60.01 59.97 59.96 59.93
1680x1050 59.95 59.88
1600x1024 60.17
1400x1050 59.98
1600x900 59.99 59.94 59.95 59.82
1280x1024 60.02
1440x900 59.89
1400x900 59.96 59.88
1280x960 60.00
1440x810 60.00 59.97
1368x768 59.88 59.85
1360x768 59.80 59.96
1280x800 59.99 59.97 59.81 59.91
1152x864 60.00
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
960x720 60.00
928x696 60.05
896x672 60.01
1024x576 59.95 59.96 59.90 59.82
960x600 59.93 60.00
960x540 59.96 59.99 59.63 59.82
800x600 60.00 60.32 56.25
840x525 60.01 59.88
864x486 59.92 59.57
800x512 60.17
700x525 59.98
800x450 59.95 59.82
640x512 60.02
720x450 59.89
700x450 59.96 59.88
640x480 60.00 59.94
720x405 59.51 58.99
684x384 59.88 59.85
680x384 59.80 59.96
640x400 59.88 59.98
576x432 60.06
640x360 59.86 59.83 59.84 59.32
512x384 60.00
512x288 60.00 59.92
480x270 59.63 59.82
400x300 60.32 56.34
432x243 59.92 59.57
320x240 60.05
360x202 59.51 59.13
320x180 59.84 59.32
DP-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
1680x1050 (0x1bf) 146.250MHz -HSync +VSync
h: width 1680 start 1784 end 1960 total 2240 skew 0 clock 65.29KHz
v: height 1050 start 1053 end 1059 total 1089 clock 59.95Hz
1280x1024 (0x1c2) 108.000MHz +HSync +VSync
h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz
v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz
1440x900 (0x1c1) 106.500MHz -HSync +VSync
h: width 1440 start 1520 end 1672 total 1904 skew 0 clock 55.93KHz
v: height 900 start 903 end 909 total 934 clock 59.89Hz
1280x960 (0x1c3) 108.000MHz +HSync +VSync
h: width 1280 start 1376 end 1488 total 1800 skew 0 clock 60.00KHz
v: height 960 start 961 end 964 total 1000 clock 60.00Hz
1024x768 (0x1c5) 65.000MHz -HSync -VSync
h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.36KHz
v: height 768 start 771 end 777 total 806 clock 60.00Hz
800x600 (0x1c6) 40.000MHz +HSync +VSync
h: width 800 start 840 end 968 total 1056 skew 0 clock 37.88KHz
v: height 600 start 601 end 605 total 628 clock 60.32Hz
640x480 (0x1c7) 25.175MHz -HSync -VSync
h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz
v: height 480 start 490 end 492 total 525 clock 59.94Hz

 

 

$ xrandr | grep -i " connected"
DVI-D-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 475mm x 267mm
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm

 xrandr | grep -i "screen"
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767

I am surprised because there is only one screen for xrandr...

 

Have a great day.

 

Regards,

Ses specs

This post was modified 1 week ago

To do: Create my signature with system and expected eGPU configuration information to give context to my posts. I have no builds.

.

ReplyQuote
 of  11