forked from SymbioticLab/FedScale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
38 lines (31 loc) · 1.15 KB
/
install.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
#!/bin/bash
FEDSCALE_HOME=$(pwd)
echo export FEDSCALE_HOME=$(pwd) >> ~/.bashrc
echo alias fedscale=\'bash ${FEDSCALE_HOME}/fedscale.sh\' >> ~/.bashrc
isPackageNotInstalled() {
$1 --version &> /dev/null
if [ $? -eq 0 ]; then
echo "$1: Already installed"
else
install_dir=$HOME/anaconda3
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
bash Anaconda3-2020.11-Linux-x86_64.sh -b -p $install_dir
export PATH=$install_dir/bin:$PATH
fi
}
# un-comment to install anaconda
isPackageNotInstalled conda
# create conda env
conda init bash
. ~/.bashrc
conda env create -f environment.yml # Install dependencies
conda activate fedscale
if [ "$1" == "--cuda" ]; then
wget https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
sudo apt-get purge nvidia-* -y
sudo sh -c "echo 'blacklist nouveau\noptions nouveau modeset=0' > /etc/modprobe.d/blacklist-nouveau.conf"
sudo update-initramfs -u
sudo sh cuda_10.2.89_440.33.01_linux.run --override --driver --toolkit --samples --silent
export PATH=$PATH:/usr/local/cuda-10.2/
conda install cudatoolkit=10.2 -y
fi