-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
54 lines (47 loc) · 1.94 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
echo "This script is not idempotent. It is to be run only once at setup"
echo "Things are sure to break if this is run a second time"
echo "Update the package list..."
sudo apt update
echo "Upgrade installed packages..."
sudo apt upgrade -y
echo "Install necessary packages to minimal Ubuntu system..."
sudo apt install -y fish wget bzip2 curl git gcc g++ python3-dev build-essential vim nano rsync htop tree screen libatlas-base-dev libboost-all-dev libopenblas-dev
sudo apt clean
sudo apt autoremove -y
echo "Install miniconda..."
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p $HOME/miniconda3
echo "Init bash for miniconda..."
echo ". $HOME/miniconda3/etc/profile.d/conda.sh" >> ~/.profile
source ~/.profile
conda init bash
conda init fish
source ~/.profile
source ~/.bashrc
rm miniconda.sh
echo "Update Miniconda"
conda update conda -q -y
conda clean -a -y -q
echo "Add a swap file"
echo "Enter swap value in GB as such: 10G for 10 GB swap area"
read swapvalue
sudo fallocate -l $swapvalue /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# verify
sudo swapon --show
echo "This doesn't update fstab for persisting swap across system reboots."
echo "Add the following at the end of /etc/fstab"
echo "/swapfile swap swap defaults 0 0"
echo "Installing GPU Drivers"
sudo apt-get install software-properties-common
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 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt update
sudo apt install -y cuda
echo "Rebooting system in 5s. Please login again after some time..."
sleep 5; sudo reboot -h now