Skip to content

Instantly share code, notes, and snippets.

@jbnunn
Last active September 17, 2022 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbnunn/f744b046d7c71f30fe5bbfb0a75632a1 to your computer and use it in GitHub Desktop.
Save jbnunn/f744b046d7c71f30fe5bbfb0a75632a1 to your computer and use it in GitHub Desktop.
Installing Ubuntu Desktop w/ CARLA on AWS

Using the CARLA autonomous driving simulator on an NVidia virutal machine

First, launch the Nvidia Gaming PC for Ubuntu 18.04 AMI from https://aws.amazon.com/marketplace/pp/B07SSKJMBJ?ref=cns_1clkPro.

Test initial installation

After the AMI boots, SSH in and check nvidia-smi to confirm you have NVIDIA drivers by default. If you don't see something similar to the below, you've launched the wrong instance.

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59       Driver Version: 440.59       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla T4            On   | 00000000:00:1E.0 Off |                    0 |
| N/A   45C    P8    16W /  70W |      0MiB / 15109MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Set an ubuntu password:

sudo passed ubuntu

Install NoMachine

wget https://download.nomachine.com/download/6.9/Linux/nomachine_6.9.2_1_amd64.deb
sudo dpkg -i no*.deb
rm no*.deb

Update the system

sudo apt-get update && sudo apt-get upgrade -y

Install a desktop

sudo apt-get install -y ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal xfce4 xterm
export DEBIAN_FRONTEND=noninteractive
sudo apt-get install -y lubuntu-desktop

Open GL

sudo apt-get install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev mesa-utils

Fix the resolution

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update
sudo apt upgrade

sudo reboot now

Install CARLA 0.9.5

wget http://carla-assets-internal.s3.amazonaws.com/Releases/Linux/CARLA_0.9.5.tar.gz
gunzip CARLA_0.9.5.tar.gz
mkdir CARLA
cd CARLA
tar -xvf ../CARLA_0.9.5.tar.gz

Install Conda and create a CARLA environment

cd /tmp
wget https://repo.continuum.io/archive/Anaconda3-2019.10-Linux-x86_64.sh
bash Anaconda3-2019.10-Linux-x86_64.sh
source ~/.bashrc
conda create -n carla python=3.5
conda activate carla

Install CARLA Python req's

cd /home/ubuntu/CARLA/PythonAPI/carla/dist
easy_install carla-0.9.5-py3.5-linux-x86_64.egg

cd /home/ubuntu/CARLA/PythonAPI/carla
pip install -r requirements.txt

cd /home/ubuntu/CARLA/PythonAPI/examples
pip install -r requirements.txt

Run CARLA

In one window:

cd /home/ubuntu/CARLA
SDL_VIDEODRIVER=offscreen ./CarlaUE4.sh -carla-server

In another:

conda activate carla
cd /home/ubuntu/CARLA/PythonAPI/examples
python manual_control.py    

Done. You've got CARLA @ 60FPS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment