Introduction

For a long time, I have a strong interest to learn about deep learning, but do not really have time to get my hand on it. In this weekend, I finnaly tried some basic machine learning project using keras & tensorflow: https://blog.keras.io/building-autoencoders-in-keras.html. But training nerual network using CPU is too slow(GTX1060 3G is 5 times faster than i5 8400!). So, I decided to install Ubuntu 18.04 on my old home machine to try GPU training.

Here is my machine’s spec(pretty old, looking forward to switch to 3rd gen Ryzen later this year):

  • MB: Gigabyte GA970A-DS3P ver2.0
  • CPU: FX-8320
  • RAM: 32GB DDR3 1600Hz
  • GPU: Nvidia GTX1060 3GB
  • SSD: Toshiba TR200 256GB SATA3

Here is the software I intended to install:

  • Ubuntu 18.04
  • Tensorflow 2.0 beta with GPU support
  • Keras 2.0+

Install & Setup Ubuntu 18.04

Install from USB

Get the offical ubuntu image from http://releases.ubuntu.com/18.04/, and create bootable USB drives using Rufus.

Setup SSH server

Setup SSH server and open up 22 port, so you can connect to it via ssh.

sudo apt install openssh-server
sudo systemctl status ssh

Check your firewall like ufw or iptables to allow incomming traffic from port 22.

WiFi Connection

WiFi is much more convient than wired etherent. However, my wifi adapter, a broadcom bcm4350, gliches when connecting to WiFi. It lists all the WiFi available, but failed to connect any one of those. I tried so hard, but no luck. https://askubuntu.com/questions/55868/installing-broadcom-wireless-drivers So I tried another USB WiFi adapter I have which is realtek rtl88x2bu. I managed to get it running after installing thrid-party driver. https://github.com/cilynx/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959

Setup Remote Access via Internet

Public IP

If you have a public IP from your ISP, then congraculate! You can just setup port redirection in your home router, then you can ssh to your machine from the Internet.

LAN Penetration

Well, if you do not have a public IP(behind a firewall, in a NAT network, etc.), you need to do something a bit tricky. For example, LAN peneration. You basically have to let your local machine connect to a cloud server. When you want to connect to you local machine from the Internet, you have to connect to that cloud server first, and then, the cloud server redirect your traffic to your local machine. frp is recommented: https://github.com/fatedier/frp#access-your-computer-in-lan-by-ssh

Setup Up Wake On Lan(WOL)

Keeping an desktop computer running 24hours a day is very enery consuming, so I want to boot it up remotly when only when I need it. In order to do this, I used a raspberry pi, which is up and running 24 hours(Its power is just about 10W). When I need my desktop mahine, I ssh to the pi, and turn on the PC using WOLhttps://help.ubuntu.com/community/WakeOnLan. Here it how I do it:

  • check the BIOS setting in your PC, enable Wake ON LAN. Check your motherboard’s maunual if necessary.
  • connect the pi and the PC usng the ethernet cable
  • fire the command from the pi: sudo etherwake <MAC_ADDRESS of the PC ethernet>. Use lshw -c network to find the MAC address. Then, the PC boots up.

Install Tensorflow with GPU

https://www.tensorflow.org/install/gpu#install_cuda_with_apt

Check GPU Utilization

# refresh stat every half second
watch -n 0.5 nvidia-smi