-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_basics.sh
116 lines (78 loc) · 3.05 KB
/
get_basics.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
#dowgrade gcc
#install java
#install teams, discord,
# verify the installation
###
### to verify your gpu is cuda enable check
#lspci | grep -i nvidia
### If you have previous installation remove it first.
#sudo apt purge nvidia* -y
#sudo apt remove nvidia-* -y
#sudo rm /etc/apt/sources.list.d/cuda*
#sudo apt autoremove -y && sudo apt autoclean -y
#sudo rm -rf /usr/local/cuda*
#install nvdia driver automaticly it will
# system update
sudo apt update && sudo apt upgrade -y
# install other import packages
sudo apt install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
#some system setting
sudo gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
sudo apt install ubuntu-restricted-extras
sudo apt install git
sudo apt install -y gnome-tweaks
#gcc version downgrade to 9
sudo apt -y install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
# first get the PPA repository driver
#sudo add-apt-repository ppa:graphics-drivers/ppa
#sudo apt update
# find recommended driver versions for you
# ubuntu-drivers devices
# install nvidia driver with dependencies
#sudo apt install nvidia-driver-535 nvidia-dkms-535 -y
# reboot
sudo reboot now
# verify that the following command works
nvidia-smi
#get java
sudo apt install default-jdk
sudo apt install default-jre
#get apps
snap install discord
snap install teams-for-linux
# get cuda proceed
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.runsudo sh cuda_11.8.0_520.61.05_linux.run
sudo sh cuda_11.8.0_520.61.05_linux.run
# setup your paths
echo 'export PATH=/usr/local/cuda-11.8/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
sudo ldconfig
# install cuDNN v11.8
# First register here: https://developer.nvidia.com/developer-program/signup
CUDNN_TAR_FILE="cudnn-linux-x86_64-8.7.0.84_cuda11-archive.tar.xz"
sudo wget https://developer.download.nvidia.com/compute/redist/cudnn/v8.7.0/local_installers/11.8/cudnn-linux-x86_64-8.7.0.84_cuda11-archive.tar.xz
sudo tar -xvf ${CUDNN_TAR_FILE}
sudo mv cudnn-linux-x86_64-8.7.0.84_cuda11-archive cuda
# copy the following files into the cuda toolkit directory.
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-11.8/include
sudo cp -P cuda/lib/libcudnn* /usr/local/cuda-11.8/lib64/
sudo chmod a+r /usr/local/cuda-11.8/lib64/libcudnn*
# Finally, to verify the installation, check
nvidia-smi
nvcc -V
#install python3 pip
sudo apt-get install python3-pip
#install cmake
pip install cmake
# install Pytorch (an open source machine learning framework)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118