File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Author: Tim Schneider <tim.schneider1@tu-darmstadt.de>
3+
4+ # Installs CUDA drivers on a fresh Ubuntu with realtime kernel. If other CUDA drivers are already installed, please remove them prior
5+ # to running this script, e.g. with
6+ # sudo apt purge 'nvidia-*'
7+ # sudo apt autoremove
8+ # sudo apt autoclean
9+
10+ # Install cuda drivers following https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu
11+ # Install linux headers for your kernel version
12+ sudo apt-get -y install linux-headers-$( uname -r) &&
13+
14+ # Delete old Nvidia key
15+ sudo apt-key del 7fa2af80;
16+
17+ # Install new Nvidia key
18+ ubuntu_version=$( lsb_release -r | awk ' {print $2}' | tr -d ' .' )
19+ arch=$( uname -m)
20+ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu${ubuntu_version} /$arch /cuda-keyring_1.1-1_all.deb -P /tmp/ &&
21+ if sudo dpkg -i /tmp/cuda-keyring_1.1-1_all.deb; then
22+ rm /tmp/cuda-keyring_1.1-1_all.deb
23+ else
24+ rm /tmp/cuda-keyring_1.1-1_all.deb
25+ exit 1
26+ fi
27+
28+ # Set IGNORE_PREEMPT_RT_PRESENCE persistently
29+ grep -qxF ' IGNORE_PREEMPT_RT_PRESENCE=1' /etc/environment || echo ' IGNORE_PREEMPT_RT_PRESENCE=1' | sudo tee -a /etc/environment > /dev/null &&
30+
31+ # Install cuda drivers
32+ sudo apt-get update &&
33+
34+ # Here we deviate from the online guide by telling the installer to ignore the presence of the realtime kernel
35+ sudo IGNORE_PREEMPT_RT_PRESENCE=1 apt-get -y install cuda-drivers &&
36+
37+ echo " Please reboot the system now."
You can’t perform that action at this time.
0 commit comments