Ubuntu GPU Server Setup
2020/06/20
A GPU server is notoriously difficult to set up mainly due to two things: installing the OS itself, and the Nvidia driver installation.
However, there's actually a very easy way to do it - that is to use a Ubuntu Server as opposed to Ubuntu Desktop. This forgoes the GUI, which is unnecessary for a server anyway, and in doing so simplifies the Nvidia driver installation.
In fact, this can all be done quickly and easily and I've set up GPU servers numerous times, so here's the guide:
Estimated time: < 1 hour
Download the “alternative” Ubuntu Server image from Ubuntu: Alternative downloads | Ubuntu.
Go to BIOS, disable
secure boot. Then boot UEFI. Install Ubuntu, overwrite full partition, addSSH Serveranddocker. Finish installation and reboot.You can now
sshin with password auth (default port is 22). For GPU, login and install nvidia driver with docker toolkit. Since secure boot is disable, nvidia installation should go smoothly.
# if you install ubuntu server no GUI, ok
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt install ubuntu-drivers-common
ubuntu-drivers devices
# this will show a list of drivers
sudo apt-get install nvidia-driver-440
# reboot required later
# install Docker
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo usermod -aG docker ${USER}
# install nvidia-container-toolkit to run Docker with GPU
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker5. Configure WiFi Connections | NetworkManager documentation (optional).
6. Enable passwordless sudo (optional):
7. setup ssh keys, authorized keys, sshd_config:
8. install zsh and change shell (optional):
9. Install libraries (optional):
10. Reboot:
Last updated
Was this helpful?