22 lines
No EOL
816 B
Bash
22 lines
No EOL
816 B
Bash
#!/usr/bin/env sh
|
|
|
|
# Check if running as root
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit
|
|
fi
|
|
|
|
# Ensure dependencies
|
|
apt install -y dirmngr ca-certificates software-properties-common apt-transport-https dkms curl
|
|
|
|
# Remove all old nvidia Drivers
|
|
apt autoremove nvidia* --purge
|
|
|
|
# Installs GPG-Keys
|
|
curl -fSsL https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/3bf863cc.pub | sudo gpg --dearmor | sudo tee /usr/share/keyrings/nvidia-drivers.gpg > /dev/null 2>&1
|
|
|
|
# Installs Nvidia Repository
|
|
echo 'deb [signed-by=/usr/share/keyrings/nvidia-drivers.gpg] https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/ /' | sudo tee /etc/apt/sources.list.d/nvidia-drivers.list
|
|
|
|
# Installs Nvidia Drivers
|
|
apt update && apt install nvidia-driver nvidia-smi nvidia-settings |