eGPU on Gnome Desktop (ThinkPad P50 + RTX 2070)  

  RSS

Hunabku
(@hunabku)
Active Member
Joined: 3 weeks  ago
Posts: 5
October 24, 2018 5:07 pm  

Hi,

I got a working setup with a ThinkPad P50, Ubuntu 18.04 (kernel 4.15.0), ASUS XG Station Pro and an RTX 2070. It is surprisingly easy to get the eGPU to be recognized by the system and use it for TensorFlow. Additionally, this is even plug-and-play capable. However, besides using the eGPU for work, I want to connect an external monitor directly to the eGPU (Lenovo P27h). With Windows 10, this setup works nicely and uses both GPUs (internal Quadro M2000M and external RTX 2070), so I assume that this should work on Linux (at least from a hardware perspective). 
After messing with the xorg.conf file for a while trying to create two "Screen" sections and using them in the ServerLayout, I can only get one of the monitors to show the Gnome desktop. The other screen (either internal or external, depending on the current configuration) stays black with an "X" cursor. After some research on that problem, I found a bug-report on the Lenovo forums that suggest that Gnome is not able to handle more than one X screen at a time (source:  https://support.lenovo.com/us/en/solutions/ht103491). However, this setup perfectly works when using XFCE instead of Gnome, resulting in two separate X screens, each of which are showing a full desktop, suggesting that my xorg config file is working as expected. I used XFCE for years, but recently got used to Gnome and all their convenient little extensions, so I'd like to continue using it. I am aware of TwinView, Xinerama and Mosaic, but none of them seem to be applicable in my situation.  

Did anyone have success in getting a similar setup working with Gnome? A basic requirement is that I don't want to manually use different boot options or configurations each time the laptop starts depending on where I use it (home, work, on the go, ...). Any hint would be greatly appreciated. If desired, I can also post a guide and some performance evaluations later on. 

Cheers


theitsage liked
ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 7 months  ago
Posts: 53
October 24, 2018 8:44 pm  

That's an interesting problem. Probably the easiest solution would be to create two different display sections in the x conf file, each using only one of the x screens you created. The only downside to this is then you would have two separate desktops that you can't drag windows between.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node) macOS 10.14+Win10+Linux Mint 19
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-macbookpro92-tb1-rx-460-akitio-node-macos-10-13-6win10/#post-43638
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-rx46010gbps-tb1-3-linux-mint-19-build-guide-benchmarks-nu_ninja/#post-47083


ReplyQuote
Hunabku
(@hunabku)
Active Member
Joined: 3 weeks  ago
Posts: 5
October 24, 2018 9:29 pm  

Thanks for your reply. When using XFCE, I already have the "problem" that I can't drag windows between the two desktops, but that is something I can get used to. I just referenced the x11 documentation and checked for the display section, since I was unaware of it except from being a subsection of screen. Could you please further specify on how that section may help me? For further reference, I attached my current x conf file. 

Section "ServerLayout"
    Identifier      "Layout0" 
    Screen 0       "Screen0" 2560 0
    Screen 1       "Screen1" LeftOf "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load "dbe"
    Load "extmod"
    Load "type1"
    Load "freetype"
    Load "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver     "mouse"
    Option     "Protocol" "auto"
    Option     "Device" "/dev/psaux"
    Option     "Emulate3Buttons" "no"
    Option     "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver     "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier       "Monitor0"
    VendorName "Unknown"
    ModelName  "LGD"
    HorizSync     52.9 - 66.7
    VertRefresh   48.0 - 60.0
    Option          "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier       "Monitor1"
    VendorName "Unknown"
    ModelName  "Lenovo Group Limited LEN P27h-10"
    HorizSync     30.0 - 120.0
    VertRefresh   50.0 - 76.0
    Option          "DPMS"
EndSection

Section "Device"
    Identifier      "Device0"
    Driver           "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName  "Quadro M2000M"
    BusID           "PCI:1:0:0"
EndSection

Section "Device"
    Identifier       "Device1"
    Driver           "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName  "GeForce RTX 2070"
    BusID           "PCI:10:0:0"
    Option          "AllowExternalGpus"
EndSection

Section "Screen"
    Identifier      "Screen0"
    Device          "Device0"
    Monitor        "Monitor0"
    DefaultDepth 24
    Option           "Stereo" "0"
    Option          "nvidiaXineramaInfoOrder" "DFP-4"
    Option          "metamodes" "1920x1080_60 +0+0"
    Option          "SLI" "Off"
    Option          "MultiGPU" "Off"
    Option          "BaseMosaic" "off"
    SubSection "Display"
       Depth 24
    EndSubSection
EndSection

Section "Screen"
    Identifier       "Screen1"
    Device           "Device1"
    Monitor         "Monitor1"
    DefaultDepth 24
    Option          "Stereo" "0"
    Option          "nvidiaXineramaInfoOrder" "DFP-4"
    Option          "metamodes" "2560x1440_60 +0+0 {AllowGSYNC=Off}"
    Option          "SLI" "Off"
    Option          "MultiGPU" "Off"
    Option          "BaseMosaic" "off"
    SubSection "Display"
       Depth 24
    EndSubSection
EndSection


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 7 months  ago
Posts: 53
October 25, 2018 12:51 am  

Now that I think about it, the display section isn't it since the monitors are connected to different devices.

Have you tried a server layout like this:

Section "ServerLayout"
    Identifier "egpu"
    Screen 0   "amdgpu"
    Inactive   "intel"
EndSection

where amdgpu and intel are the screens referencing those devices? This is what I'm using to get multiple displays and you look like you have something different.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node) macOS 10.14+Win10+Linux Mint 19
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-macbookpro92-tb1-rx-460-akitio-node-macos-10-13-6win10/#post-43638
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-rx46010gbps-tb1-3-linux-mint-19-build-guide-benchmarks-nu_ninja/#post-47083


ReplyQuote
Hunabku
(@hunabku)
Active Member
Joined: 3 weeks  ago
Posts: 5
October 25, 2018 6:55 am  

Thanks for the suggestion. I tried ServerLayouts like that, using only one of the two screens. Depending on if I use Screen0 or Screen1, the Gnome destkop is shown on the respective monitor and device. The "other" monitor turns black when switching to the session that runs gdm3.
I am not using hybrid graphics on the laptop for various reasons, so I configured the BIOS to only use the discrete GPU.


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 7 months  ago
Posts: 53
October 25, 2018 2:24 pm  

So it looks like GNOME is special in that it uses Wayland by default. You could try selecting "Gnome on Xorg" before logging in or setting it in some other way to see if that changes anything.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node) macOS 10.14+Win10+Linux Mint 19
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-macbookpro92-tb1-rx-460-akitio-node-macos-10-13-6win10/#post-43638
https://egpu.io/forums/builds/mid-2012-13-macbook-pro-rx46010gbps-tb1-3-linux-mint-19-build-guide-benchmarks-nu_ninja/#post-47083


ReplyQuote
Hunabku
(@hunabku)
Active Member
Joined: 3 weeks  ago
Posts: 5
October 25, 2018 4:36 pm  

Xorg is the default on 18.04 LTS, but I read a little into Wayland and gave it a shot. However, only the Xorg version actually lets me log in to my desktop. When trying to log into a Wayland session, the screen just flickers multiple times and throws me back to the login screen, so I assume it just crashes for some reason. The syslog has the following errors in it when trying to load into Wayland. 

$> org.gnome.ScreenSaver[1548]: Unable to init server: Could not connect: Connection refused
$> gnome-session[1496]: gnome-session-binary[1496]: CRITICAL: Unable to create a DBus proxy for GnomeScreensaver: Error calling StartServiceByName for org.gnome.ScreenSaver: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.ScreenSaver exited with status 1
$> dbus-daemon[1548]: [session uid=1000 pid=1548] Activated service 'org.gnome.ScreenSaver' failed: Process org.gnome.ScreenSaver exited with status 1
$> [1675]: Cannot open display:
$> gnome-session-binary[1496]: CRITICAL: Unable to create a DBus proxy for GnomeScreensaver: Error calling StartServiceByName for org.gnome.ScreenSaver: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.ScreenSaver exited with status 1
$> gnome-shell[1685]: Failed to create backend: No resources
$> gnome-session[1496]: gnome-session-binary[1496]: WARNING: App 'org.gnome.Shell.desktop' exited with code 1
$> gnome-session-binary[1496]: Unrecoverable failure in required component org.gnome.Shell.desktop
$> gnome-session-binary[1496]: WARNING: App 'org.gnome.Shell.desktop' exited with code 1


ReplyQuote
(@timur_kristof)
Active Member
Joined: 8 months  ago
Posts: 17
October 26, 2018 10:45 am  
Posted by: Hunabku

Xorg is the default on 18.04 LTS, but I read a little into Wayland and gave it a shot. However, only the Xorg version actually lets me log in to my desktop. When trying to log into a Wayland session, the screen just flickers multiple times and throws me back to the login screen, so I assume it just crashes for some reason

The NVidia proprietary drivers still don't quite agree with Wayland, so I would suggest to simply not use Wayland with NVidia hardware, for now.


ReplyQuote