Skip to content

Commit 343125b

Browse files
authored
Update n-series-driver-setup.md
1 parent 4ef58e8 commit 343125b

File tree

1 file changed

+85
-1
lines changed

1 file changed

+85
-1
lines changed

articles/virtual-machines/linux/n-series-driver-setup.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,87 @@ sudo apt-get install cuda-drivers
7777
sudo reboot
7878
```
7979

80+
#### Install CUDA driver on Ubuntu with Secure Boot enabled
81+
82+
With Secure Boot enabled, all Linux kernel modules are required to be signed by the key trusted by the system.
83+
84+
1. Find latest nvidia driver version
85+
86+
```
87+
sudo apt-get update
88+
NVIDIA_DRIVER_VERSION=$(sudo apt-cache search 'linux-modules-nvidia-[0-9]+-azure$' | awk '{print $1}' | sort | tail -n 1 | head -n 1 | awk -F"-" '{print $4}')
89+
```
90+
91+
2. Install pre-built azure linux kernel based nvidia modules and driver
92+
93+
```
94+
sudo apt install -y linux-modules-nvidia-${NVIDIA_DRIVER_VERSION}-azure nvidia-driver-${NVIDIA_DRIVER_VERSION}
95+
```
96+
97+
3. Change preference of nvidia packages to prefer NVIDIA repos
98+
99+
```
100+
sudo tee /etc/apt/preferences.d/cuda-repository-pin-600 > /dev/null <<EOL
101+
Package: nsight-compute
102+
Pin: origin *ubuntu.com*
103+
Pin-Priority: -1
104+
Package: nsight-systems
105+
Pin: origin *ubuntu.com*
106+
Pin-Priority: -1
107+
Package: nvidia-modprobe
108+
Pin: release l=NVIDIA CUDA
109+
Pin-Priority: 600
110+
Package: nvidia-settings
111+
Pin: release l=NVIDIA CUDA
112+
Pin-Priority: 600
113+
Package: *
114+
Pin: release l=NVIDIA CUDA
115+
Pin-Priority: 100
116+
EOL
117+
```
118+
119+
4. Add CUDA repository
120+
121+
```
122+
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
123+
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
124+
```
125+
126+
5. Find appropriate CUDA driver version
127+
128+
```
129+
CUDA_DRIVER_VERSION=$(apt-cache madison cuda-drivers | awk '{print $3}' | sort -r | while read line; do
130+
if dpkg --compare-versions $(dpkg-query -f='${Version}\n' -W nvidia-driver-${NVIDIA_DRIVER_VERSION}) ge $line ; then
131+
echo "$line"
132+
break
133+
fi
134+
done)
135+
NVIDIA_DRIVER_MAPPING=$(echo $CUDA_DRIVER_VERSION | awk -F"." '{print $1}')
136+
```
137+
138+
6. Install CUDA driver
139+
140+
```
141+
sudo apt install -y cuda-drivers-${NVIDIA_DRIVER_MAPPING}=${CUDA_DRIVER_VERSION} cuda-drivers=${CUDA_DRIVER_VERSION}
142+
```
143+
144+
7. Find CUDA toolkit and runtime version
145+
146+
```
147+
CUDA_VERSION=$(apt-cache showpkg cuda-drivers | grep -o 'cuda-runtime-[0-9][0-9]-[0-9],cuda-drivers [0-9\.]*' | while read line; do
148+
if dpkg --compare-versions ${CUDA_DRIVER_VERSION} ge $(echo $line | grep -Eo '[[:digit:]]+\.[[:digit:]]+') ; then
149+
echo $(echo $line | grep -Eo '[[:digit:]]+-[[:digit:]]')
150+
break
151+
fi
152+
done)
153+
```
154+
155+
8. Install CUDA toolkit and runtime
156+
157+
```
158+
sudo apt install -y cuda-${CUDA_VERSION}
159+
```
160+
80161

81162
### CentOS or Red Hat Enterprise Linux
82163

@@ -200,7 +281,6 @@ To install NVIDIA GRID drivers on NV or NVv3-series VMs, make an SSH connection
200281
blacklist lbm-nouveau
201282
```
202283
203-
204284
4. Reboot the VM and reconnect. Exit X server:
205285
206286
```bash
@@ -237,6 +317,10 @@ To install NVIDIA GRID drivers on NV or NVv3-series VMs, make an SSH connection
237317
```
238318
10. Reboot the VM and proceed to verify the installation.
239319

320+
#### Install GRID driver on Ubuntu with Secure Boot enabled
321+
322+
The GRID driver installation process does not offer any options to skip kernel module build and installation, so secure boot has to be disabled in Linux VMs in order to use them with GRID, after installing signed kernel modules.
323+
240324

241325
### CentOS or Red Hat Enterprise Linux
242326

0 commit comments

Comments
 (0)