Skip to content

Instantly share code, notes, and snippets.

@benfoley
Last active July 26, 2021 01:50
Show Gist options
  • Save benfoley/a4103990f5ee14d0558f7dbc10bef5c2 to your computer and use it in GitHub Desktop.
Save benfoley/a4103990f5ee14d0558f7dbc10bef5c2 to your computer and use it in GitHub Desktop.
Google Cloud Platform GPU installation steps for Elpis
# Install gpu drivers
sudo apt install linux-headers-$(uname -r)
curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt update
sudo apt -y install cuda
# Install docker instructions from https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
curl https://get.docker.com | sh && sudo systemctl --now enable docker
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-docker2
sudo systemctl restart docker
# Verify
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
@benfoley
Copy link
Author

Optionally, download and share the na data

This data is currently required to run the HFT code, it is hard-linked in the model file.

Use this tool to create a wget command: https://gdrive-wget.glitch.me

cd /
sudo mkdir na-elpis && cd na-elpis

sudo wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1tywUAtOUnAeITxC-YL61I5iTADIipeYS' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1tywUAtOUnAeITxC-YL61I5iTADIipeYS" -O data.zip && rm -rf /tmp/cookies.txt

sudo unzip data.zip
sudo docker run --gpus all --name elpis -v /na-elpis:/na-elpis --rm -it -p 80:5000/tcp coedl/elpis:hft-test

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