Skip to content

Instantly share code, notes, and snippets.

View fmacrae's full-sized avatar

Finlay Macrae fmacrae

View GitHub Profile
@fmacrae
fmacrae / Deepracer for cloud local initial setup
Last active June 14, 2023 13:44
Work in progress. trying to geta clean set of instructions to build a local training rig
#Assumes starting from a clean install of ubuntu and running a nvidia graphics card
#Install NVIDIA drivers and disable noveuax generic drivers
#TODO
#purge the ones you have
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get remove --purge '^libnvidia-.*'
sudo apt-get remove --purge '^cuda-.*'
sudo apt autoremove
#download the latest runfile from nvidia and follow the install instructions
@fmacrae
fmacrae / Lightsail min build
Created April 23, 2020 20:35
Fast.ai Running on minimal Lightsail instance
#build a swap file as you'll oom
sudo swapon --show
sudo fallocate -l 1G /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
sudo swapon --show
sudo free -h
#if you used the defaults from course.fast.ai this should work. Change your DEST_ZONE to match the target zone
#check which zones have K80 GPU:
gcloud beta compute accelerator-types list | grep k80
#define your disk name, instance name, and source and target zones
export INSTANCE_NAME="my-fastai-instance"
export SOURCE_ZONE="us-west2-b"
export DEST_ZONE="asia-east1-b"
export DISK_NAME="my-fastai-instance"
@fmacrae
fmacrae / AWS Lightsail for Chapter deployment
Last active October 22, 2019 15:24
Getting Chapter Running on AWS Lightsail $3.5 instance
Create a new Lightsail instance (the smallest one seems to support it)
Use the Bitnami node.js template
Paste this in as a Launch Script:
#better launch script - installs current versions of docker components.
sudo apt-get remove -y docker docker-engine docker.io containerd runc
sudo apt-get update -y
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@fmacrae
fmacrae / Deep Racer on GCP
Last active October 31, 2022 20:59
Getting Deepracer 'local' training running on Google Cloud Compute
Follow instructions from older version of https://course.fast.ai/start_gcp.html
Step 1: Creating your account
Cloud computing allows users access to virtual CPU or GPU resources on an hourly rate, depending on the hardware configuration. Find more information in the Google Cloud Platform documentation. In case you don’t have a GCP account yet, you can create one here, which comes with $300 worth of usage credits for free.
Potential roadblock: Even though GCP provides a $300 initial credit, you must enable billing to use it. You can put a credit card or a bank account but the latter will take several days for the activation.
The project on which you are going to run the image needs to be linked with your billing account. For this navigate to the billing dashboard, click the ‘…’ menu and choose ‘change billing account’.
Step 2: Install Google CLI