Skip to content

Commit 8e8d0e0

Browse files
Added install_cuda_realtime.bash script
1 parent c11fe35 commit 8e8d0e0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tools/install_cuda_realtime.bash

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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."

0 commit comments

Comments
 (0)