-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathvideo.sh
executable file
·47 lines (37 loc) · 1.38 KB
/
video.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
#!/usr/bin/env bash
# Installation script for AMD/NVIDIA video drivers.
. helper.sh
install_ati_driver(){
apt-get update -y
apt-get install -y firmware-linux-nonfree amd-opencl-icd linux-headers-$(uname -r) fglrx-atieventsd fglrx-driver fglrx-control fglrx-modules-dkms -y
aticonfig --initial -f
}
install_nvidia_cuda(){
apt_super_upgrade
aptitude -r install linux-headers-$(uname -r)
apt-get install -y nvidia-xconfig nvidia-kernel-dkms
apt-get install -y firmware-linux-nonfree nvidia-opencl-icd nvidia-cuda-toolkut
}
install_nvidia_docker(){
id=$(. /etc/os-release;echo $ID)
version_id=$(. /etc/os-release;echo $VERSION_ID)
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
if [[ $id == 'kali' ]]; then
distribution=ubuntu18.04
fi
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey |sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt update && sudo apt -y install nvidia-container-toolkit
}
install_video_driver(){
if ask "Install ATI/AMD driver fglrx?" N; then
install_ati_driver
fi
if ask "Install NVIDIA driver nouveau?" N; then
install_nvidia_driver
fi
}
if [ "${0##*/}" = "video.sh" ]; then
install_video_driver
fi