EGpu Tutorial: Step By Step Process – Ubuntu 18.04 + Intel NUC + eGPU

In order to boost our ability to train and utilise our machine learning based software, we have decided to have a dedicated system to do this. Due to our budget and space we went with using our Intel NUC with latest i9 processor combined with a Razer Core X eGPU as our Machine Learning R&D rig.

Greenroom Robotics primarily uses Ubuntu 18.04 (Bionic Beaver) as our development OS, and because of the consumer focussed world we live in, we can’t unfortunately just plug it in and expect everything will work. As such I have just spent the day getting everything working together just the way we want it.

I figured that there would definitely be others out there like me, and thought it was about time I contributed to world of internet tutorials, as they have helped me so much in the past. I would like to preface everything in saying that this probably won’t work for everyone, and this is how I have done it to the way I wanted it, so if you disagree, leave a comment or just don’t read it.

The Process I followed, on a fresh install of Ubuntu 18.04, was as follows:

  1. Update the kernel
  2. Enable the thunderbolt
  3. Get NVIDIA and CUDA drivers running (hard part)

Before you start, get comfy, I set up everything in front of my couch and used the TV so that if I got too angry I could just switch over to NetFlix. The Hardware I am working with is:

  • Razer Core X
  • NVIDIA GeFORCE RTX 2070
  • Intel Skull Canyon NUC running Intel® Core™ i7-6770HQ CPU @ 2.60GHz × 8 and 16GB of RAM.
  • Ubuntu 18.04

If you have the time and resource, I would also recommend the following:

  • Patience
  • Pot of Coffee
  • Tunes

Now, let’s get into it!

Step One – The Kernal

First we need to Install a GUI that helps and makes life easy. There are other ways to do this manually via the terminal, but I found this to be the easiest way. Open up the terminal and run the following.

$ sudo apt-add-repository ppa:teejee2008/ppa

$ sudo apt update

$ sudo apt-get install ukuu

That should install it. To run it:

$ sudo ukuu-gtk

This window should come up. If the top entry says ‘running’ you are in the clear and can exit. If not, select the top (latest) Kernel and then click the install button on the right, could take a few minutes depending on your system/internet etc.

Plug the eGPU box into the computer/NUC, then reboot.

Step 2 – Enabling Thunderbolt

On Ubuntu 18.04 you can check the status of the thunderbolt devices, so click on ‘Settings’ then ‘Devices’  then ‘Thunderbolt’, should get a screen like this one.

If you can’t see the Razer Core X in the list, first try rebooting and entering BIOS and enabling the thunderbolt and making sure “Secure Boot” is disabled. Failing that, google it for your specific system. If you can see the Razer Core X in the devices, make sure it says ‘Activated’. If it isn’t, click on it and activate it.

Step 3 – CUDA and NVIDIA Driver (This is always the painful part)

First we need to download CUDA. THere are some tutorials out there that say install the NVIDIA drivers first, but that has never once worked for me trying to get CUDA working. You can Download it from (https://developer.nvidia.com/cuda-downloads) for your system.

While that is downloading,  we need to sort out the dependencies, open up a terminal and run:

$ sudo apt-get install build-essential dkms

$ sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev

When the download is done, we need to install it. In a terminal,

$ sudo dpkg -i ~/Downloads/cuda-repo-ubuntu1804-10-1-local-10.1.105-418.39_1.0-1_amd64.

$ sudo apt-key add /var/cuda-repo-10-1-local-10.1.105-418.39/7fa2af80.

$ sudo apt-get

$ sudo apt-get install cuda

$ sudo apt-get purge nvidia* 

$ sudo add-apt-repository ppa:graphics-drivers

$ sudo apt-get update

To check we are on track, run:

$ ubuntu-drivers devices

Something like this should be displayed:

If there is nothing there, google it, you are on your own. If not, run:

$ sudo ubuntu-drivers autoinstall

You can specify the driver (sudo apt install nvidia-340) but always seems to be issues for some reason when I try. To check it worked. Run:

$ nvidia-smi

This should be seen, validating that the eGPU is woking with our system.

And we are DONE! Let me know if there is anything you would want me to go into more detail about or if this helped you (Its my first try at a tutorial, all feedback welcomed).

1 thought on “EGpu Tutorial: Step By Step Process – Ubuntu 18.04 + Intel NUC + eGPU

  1. Curious, is this still working for you on Ubuntu 20.04 with kernel 5.4? Because I can’t for the life of me get the Razer Core X to show up in the thunderbolt device list to begin with.

Leave a Reply

Your email address will not be published. Required fields are marked *