-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
67 lines (54 loc) · 1.96 KB
/
install.sh
File metadata and controls
67 lines (54 loc) · 1.96 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
#!/bin/bash
FEDSCALE_HOME=$(pwd)
if [[ $(uname -s) == 'Darwin' ]]; then
echo MacOS
echo export FEDSCALE_HOME=$(pwd) >> ~/.bash_profile
echo alias fedscale=\'bash ${FEDSCALE_HOME}/fedscale.sh\' >> ~/.bash_profile
else
echo export FEDSCALE_HOME=$(pwd) >> ~/.bashrc
echo alias fedscale=\'bash ${FEDSCALE_HOME}/fedscale.sh\' >> ~/.bashrc
fi
isPackageNotInstalled() {
$1 --version &> /dev/null
if [ $? -eq 0 ]; then
echo "$1: Already installed"
elif [[ $(uname -p) == 'arm' ]]; then
install_dir=$HOME/miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh
bash Miniconda3-latest-MacOSX-arm64.sh -b -p $install_dir
export PATH=$install_dir/bin:$PATH
else
install_dir=$HOME/miniconda
wget wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $install_dir
export PATH=$install_dir/bin:$PATH
fi
}
# un-comment to install conda
isPackageNotInstalled conda
# create conda env
# if [[ $(uname -p) == 'arm' ]]; then
# source ~/miniconda/bin/activate
# . ~/.bash_profile
# conda env create -f environment-arm.yml
# conda install -c apple tensorflow-deps
# conda activate fedscale
# python -m pip install tensorflow-macos==2.9
# python -m pip install tensorflow-metal==0.5.0
# else
source ~/miniconda/bin/activate
conda init bash
. ~/.bashrc
conda env create -f fedfetch-environment.yml
conda activate fedfetch
# fi
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