Skip to content

Instantly share code, notes, and snippets.

@GarrettMooney
Created May 3, 2020 01:29
Show Gist options
  • Save GarrettMooney/20de60820707a356584992923e5653c3 to your computer and use it in GitHub Desktop.
Save GarrettMooney/20de60820707a356584992923e5653c3 to your computer and use it in GitHub Desktop.
Toggle between using GPU for Deep Learning and Video Games.
#!/bin/bash
flag=$1
if [[ $flag == 'DL' ]]; then
# -------------
# Deep Learning
# -------------
echo "Configuring GPU for Deep Learning..."
sudo apt-get install -y libnvidia-common-440
sudo apt-get install -y cuda
sudo apt-get install -y cuda-drivers
sudo apt-get install -y nvidia-driver-418
sudo apt-get install -y cuda
sudo apt-get install -y libcupti-dev
python3 -m pip install --user --upgrade tensorflow-gpu
python3 -m pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
echo "Now we reboot..."
reboot
elif [[ $flag == 'VG' ]]; then
# -----------
# Video games
# -----------
echo "Configuring GPU for Video Games..."
sudo apt-get install -y libnvidia-compute-440
sudo apt-get install -y libnvidia-gl-440
sudo ubuntu-drivers autoinstall
echo "Now we reboot..."
reboot
else
echo "Don't forget to supply either 'DL' or 'VG' as an additional argument."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment