Setup & Software Discussions
eGPU in Ubuntu 18.04 works flawlessly
 

eGPU in Ubuntu 18.04 works flawlessly  

  RSS

gt0242
(@gt0242)
Active Member
Joined: 2 years ago
 

I have a Mid-2012 Macbook Pro with 16GB ram and 2TB SSD. The eGPU is an Aorus Gaming Box 1080. I am using it as a native GPU for my laptop, full internal screen acceleration, able to run Steam Proton games, Blender rendering and CUDA. Without any major hassles or setup steps.

What I did -

  1. Installed Ubuntu 18.04.
  2. Installed Nvidia 396 proprietary drivers.
  3. Ensured I had nvidia-prime installed. 
  4. In the terminal ran prime-select nvidia.
  5. Rebooted
  6. For first time boot added boot parameter "nvidia-drm.modeselect=1". Didn't have to do this for any later logins.
  7. GTX 1080 was recognised and used by system as native GPU. Internal screen is automatically accelerated. All apps use the eGPU by default.
  8. Connected eGPU to my UHD (4K?) TV via HDMI. TV screen was recognised instantly by the system and set to its max resolution.

Have since upgraded to Nvidia 410, without any issues.

Caveats -
No hotplugging. Since it is used as native GPU needs to be connected at login. If you want you can disconnect eGPU at login and system simply uses the iGPU.

Performance -
What you would expect from a eGPU on a TB1 connection. Thankfully since the screen resolution is 1280x720, there are no performance bottlenecks. I have attached screenshots for Heaven benchmark using internal screen and UHD TV. 
https://imgur.com/HzgY0Lf
https://imgur.com/St9aTKr

Bottomline - 
My experience with Ubuntu 18.04 has been so good that I no longer login to MacOS. Its only purpose is to serve as a means for my iphone/ipad backups. I don't see any need to use macos anymore. Apple makes us jump through two many hoops for simple things, OR pay tonnes of money. 
I am planning to see if I can get Unreal Editor running in Proton on my setup. Will update if that works.
My laptop is due an upgrade. I am need to decide between the XPS 13 or 15 or Alienware 13r3. With Linux now an absolute viable replacement to windows and macos for my needs and my ability to run MacOS in Virtualbox, I don't think I will be getting a new macbook for some years now.

This topic was modified 12 months ago

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


jeemaline, itsage, mac_editor and 1 people liked
ReplyQuote
mac_editor
(@mac_editor)
Noble Member Moderator
Joined: 3 years ago
 

This is good stuff! Perhaps a link/guide to installing Ubuntu natively on Mac may round up this guide really well.

purge-wrangler.shpurge-nvda.shset-eGPU.shautomate-eGPU EFI Installer
2018 MacBook Pro 15" RP560X + Vega 64 (Mantiz Venus MZ-02)


itsage liked
ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 2 years ago
 

@gt0242

So if I read this correctly, you're able to boot with or without your eGPU plugged in? My setup with an AMD card wasn't quite as nice and this is something I'm still figuring out.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


ReplyQuote
gt0242
(@gt0242)
Active Member
Joined: 2 years ago
 

@mac_editor : For installing Ubuntu 18.04 I did the following,

  1. Download latest live CD from Ubuntu site
  2. Use Unetbootin to write the cd onto a USB drive
  3. I use refind on my macbook pro. They have an excellent guide for installing refind in macos. Refind automatically lists all bootable drives - internal and external.
  4. So connect usb, reboot and select the Ubuntu boot option in refind menu.
  5. To install Ubuntu without installing grub, since I have refind, I started the installer from the terminal using this command - "ubiquity --no-bootloader"
  6. Then follow the prompts of the installer and ensure to select to install proprietary drivers.
  7. Once the installer is done, reboot, remove USB drive and select the Ubuntu option from refind menu.
  8. In Ubuntu, open terminal use "sudo apt install nvidia-driver-xxx" to install latest nvidia drivers.
  9. After the install is done run the command "prime-select nvidia".
  10. Once this is done Reboot.
  11. On refind menu select "Ubuntu" option and press <tab>. Enter this at the end of the boot options "nvidia-drm.modeselect=1". This is one time. I have not had to use it again.
  12. Press enter after setting the boot option, boot into Ubuntu and enjoy!

This will work best in a Macbook or laptop with only iGPU and eGPU with Nvidia card. For other systems it could require more steps to configure the drivers.

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


mac_editor and itsage liked
ReplyQuote
gt0242
(@gt0242)
Active Member
Joined: 2 years ago
 

@nu_ninjaI haven't looked into this carefully but I can see prime-select makes a custom boot image with the nvidia drivers as the main/sole drivers at boot. I believe this allows the "nvidia-settings" software to kick in and set everything up. For systems with a dGPU or AMD eGPU, this would mean figuring out how to generate custom boot image(s) that work similarly.

Btw, prime-select is a python script. If you are so inclined, you can check them out and see if they can be modified to help out with your configuration.

Also, if I don't connect the eGPU at boot and hot plug it after booting, it is still recognised and it works for CUDA and rendering. I only have issues getting Steam to use it and run games. I've found that in linux with the latest kernels installed, eGPU over thunderbolt is pretty much plug and play for using it for non-gaming tasks.

 

This post was modified 12 months ago

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 2 years ago
 

Thanks for the tip. I think I've got it working pretty well now. I pretty much copied the config file from the Arch wiki on prime and added a second server layout block with the iGPU as primary. Here's my full configuration file:

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

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

Section "Device"
Identifier "amdgpu"
Driver "amdgpu"
BusID "PCI:10:0:0"
#BusID in decimal, convert from hex
# Option "AllowEmptyInitialConfiguration"
# Option "AllowExternalGpus"
EndSection

Section "Screen"
Identifier "amdgpu"
Device "amdgpu"
EndSection

Section "Device"
Identifier "intel"
Driver "intel"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection

so logging in normally starts with the iGPU, but logging in through the console (Ctrl-Alt-F1) and running

 startx -- -layout egpu 

starts a session with the eGPU as primary. This fixed my problem of starting up with or without the eGPU connected.
I'd definitely like to see more eGPU on linux, it seems pretty plug and play with nvidia and not too bad with amd either once you figure it out, but more complex setups could prove otherwise.

This post was modified 12 months ago

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


itsage liked
ReplyQuote
itsage
(@itsage)
Famed Member Admin
Joined: 3 years ago
 

Nice to see eGPU on Linux is getting easier to implement. We’d love to see a build guide when you have time.

Best ultrabooks for eGPU use

eGPU enclosure buying guide


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 3 years ago
 

@nu_ninja

Hi,  my late 2016 MacBook pro 13,3 (15 inch w Touch Bar) is setup as tri-boot with macOS HS, win 10 and Ubuntu 18.10 with kernel 4.19. I have an eGPU Nvidia 1080ti with Akitio thunder 3 mod’ed. eGPU all setup to work under MacOS and win.

I’m now trying to set this up under Linux. I got the system recognize the box and egpu and next step will be to install CUDA to use it for GPU rendering, etc with 3D apps. However, I would like to also try to use the egpu as primary gpu under Linux and deactivate intel iGPU and Radeon 460 dGPU (also because amdgpu driver is not very stable as the card gets too hot and some times it shuts down producing kernel panic). 

Would you mind elaborate a little more the steps in regard to drivers to use (open source vs proprietary) and how to configure Xorg and exactly what kernel parameters to add to /etc/default/grub in order to achieve what you achieved but with a dGPU in the mix? Thanks!

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Estimable Member
Joined: 2 years ago
 

I'd use the nvidia proprietary drivers as that's what most people seem to have used so far on this forum. You can try an x config like the one from the sticky which should just use the egpu as the primary and only graphics device.

Edit:
I see sebulon has given you similar advice in the other sticky thread. That'll do a similar thing but fully automated so I'd try that method first

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460/560 (AKiTiO Node/Thunder2)
+ macOS 10.14+Win10
+ Linux Mint 19.1


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 3 years ago
 

@nu_ninja 

Sounds good, thanks.

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote
marquefilips
(@marquefilips)
Active Member
Joined: 10 months ago
 

I have not been able to resolve getting the driver working with the egpu - the external system is recognized by lspci but that is all. Has anyone posted details of what makes this work?

2012 MBP15" 10.13.6, Razer X Core, NVIDIA GTX 1080, (internal Intel HD 4000/Nvidia), Nvidia 387.10.10.10.40.105, Cuda 387.130, TF 1.5 AND 2017 MBP15” 10.13.6 Razer X Core, NVidia GTX and Nvidia GTX GeForce Titan Black (when it’s not misbehaving).


ReplyQuote
DrEGPU
(@dregpu)
Trusted Member
Joined: 11 months ago
 
I'm using an old MacBook Pro 13 2011 with an Aorus gaming box 1080, via apple TB3-->TB1/2 adapter, as well. It works pretty great, when driving the internal display! 
Followed the instructions in the OP. Here's how I installed the nVidia drivers.

I used:
ubuntu-drivers devices
to make sure the system was seeing my 1080
And then:
sudo ubuntu-drivers autoinstall
to install the nvidia driver

Here's my benchmarks:
Unigine Heaven 4.0:
    pts/unigine-heaven-1.6.4 [Resolution: 1280 x 800 - Mode: Fullscreen - Renderer: OpenGL]
    Test 1 of 1
    Estimated Trial Run Count:    3                      
    Estimated Time To Completion: 15 Minutes [12:28 EST] 
        Started Run 1 @ 12:13:54
        Started Run 2 @ 12:18:33
        Started Run 3 @ 12:23:07

    Resolution: 1280 x 800 - Mode: Fullscreen - Renderer: OpenGL:
        102.786
        103.542
        104.161

    Average: 103.50 Frames Per Second
    Deviation: 0.67%

MBP 2018 15 inch + 2X Aorus gaming box 1080 in BootCamp and MacOS 10.13.6
2011 13-inch MacBook Pro + Razer Core X@10Gbps-TB1 (Zotac RTX 2080 Ti Amp) + Ubuntu 18.04


ReplyQuote
dimebar
(@dimebar)
New Member
Joined: 7 months ago
 

hi,

has anyone tried this on Minx dual boot ?

wanting to upgrade my pc dual boot Minx OS but not sure if this will work ?

thankd

Pending: Add my system information and expected eGPU configuration to my signature to give context to my posts


ReplyQuote