Making your own server

I wrote up the steps for setting up a server in Ubuntu (Windows dual boot). For the complete Ubuntu/Windows ignoramus, like I am, or was.

Perhaps someone could add it to the Wiki Installation pages?

Start----------------------------------------------------------------------------------------
Setup Ubuntu local server, for beginners (including Windows dual boot)

This guide is geared toward beginners with Ubuntu and Windows, to get you set up for the course with minimal hassles. I will try to clearly lay out every step needed, without assuming that you already have prior skills with these OS’s.

I do assume that you are starting with a PC and an nVidia GPU. This guide is current as of 18-March-2017. The Ubuntu version installed is 16.04.2 LTS. For other Ubuntu versions and and hardware, YMMV.

Making the Ubuntu Installer

In this section, we create the Ubuntu installer on a flash drive, from Windows. If you are not starting from Windows, you will need to create the installer a different way. You will need a USB flash drive, 2 GB or larger.

To create the bootable installer drive, follow the instructions at

Installing Ubuntu

You will be installing Ubuntu in its own partition, separate from the Windows partition. You may find instructions that recommend using the Windows Disk Manager to pre-allocate a partition for Ubuntu. This is neither necessary nor advised. WDM is limited in how much it can shrink the Windows partition because there are system files that cannot be moved while Windows runs. The Ubuntu installer itself can do the partitioning better than WDM because Windows is not running and can be shrunk further. Just know your ideal partition sizes before proceeding.

The Ubuntu installer advises that an internet connection will speed up the installation. Actually, a bug in the installer will cause the installation to fail partway through when there is an internet connection. So disconnect internet during the install, and don’t waste time figuring this out.

Next, boot from the installer. This will likely require entering the BIOS screens to select the USB flash drive as the boot device.

The installer will let you choose “Install them side by side, choosing between them each startup” (for dual boot), and let you size the two partitions.

Once the installer finishes, remove the flash drive and boot from the hard drive. If all has gone well, you will see a menu that allows the choice between Ubuntu and Windows.

Navigating Ubuntu

At the top of the Launcher is a search tile that allows you to find programs quickly. Terminal is one you will be using soon. Note that Ctrl-v does not work in Terminal. You have to right-click and select Paste from the menu.

The next tile below is the file browser with your Home directory as the root. At this point, go to Edit->Preferences->Views. Select “Show hidden and backup files”. You will need to edit some of these later.

System Settings (looks like a gear and wrench) gives access to many settings for personalizing Ubuntu. Be careful with the “Additional Drivers” tab. Ubuntu will offer to install a proprietary driver from nVidia. If you install it, you will be locked out of Ubuntu in a login screen loop. Instructions for escaping this situation are in the notes below.

Shutdown and reboot are found in the gear icon in the upper right corner.

Setting up the GPU and Course Material
Note: do NOT install the nVidia drivers offered in System Settings->Additional Drivers.

Fortunately, several generous experts have created a script that does the setup automatically. The script is found at

If you are easy with git, you can get the script file directly. Or click the Raw link, and using Text Editor simply copy/paste into a local file named install-GPU.sh.

Note that the script has recently been revised to install an older version of Keras, the one that the course’s code was designed for. Later you may want to update to the current Keras 2.

One small problem is that the script calls git, which is not yet installed. To install git, open a Terminal window and enter

sudo apt install git

Now it’s time to run the script. From the Terminal window, enter

bash ‘path-to/install-gpu.sh’
(You may simply type "bash ", and drag the script file to Terminal to enter its path.)

Wait while the script runs.

As part of its operations, the script will install an up-to-date nVidia driver, one that does not have the boot loop problem. At some point, Ubuntu required me to enable Insecure Boot Mode and provided the steps. I do not recall when this occurred.

Reboot now.

Open Terminal, and enter

nvidia-smi

If all has gone well, you will see the GPU and its state.

Running the Notebooks

A configuration change makes this more convenient. Open the .jupyter invisible folder found in Home, and edit jupyter_notebook_config.py. Edit the matching line to

c.NotebookApp.notebook_dir = u’courses/deeplearning1/nbs/’

This way jupyter will always open to the notebooks directory.

Next, enter in Terminal

jupyter notebook

To access the jupyter server, open a browser window and go to

http://localhost:8888

You should see a file list that contains the lesson notebooks for the course. Open one of them and you are ready to work.

Random Notes

  • Inside a jupyter notebook, use shift-enter to run a cell.

  • To monitor GPU load, enter in a second Terminal,
    watch nvidia-smi

  • Run Software Updater to get security updates that were not part of the installer.

  • To escape from the nVidia driver boot loop, at login type Ctrl + Alt + F1. At the login prompt, type your user name all lowercase, then your password. This is called TTY login.

type
sudo apt-get purge nvidia-*

and reboot.

  • To browse root level, type in Terminal

gksu nautilus

End---------------------------------------------------------------------------------------------------------------

Also, feel free to edit and correct.

On to Lesson 2!

Malcolm

2 Likes