#setup cuda kit for wsl2 ubuntu 22.04 for RTX Pro 4000
#### update and make sure some tools are there ####
sudo apt update && sudo apt upgrade -y
sudo apt-get install -y ca-certificates curl gnupg
#### install corporate certs if behind corporate network or zscaler ####
#### this part is only needed if need to trust certificates from the network infrastructure side.
#### if not behind a company network or zscaler, simply comment out
# Pull full chain as seen inside WSL (includes Zscaler, Company, etc)
openssl s_client -showcerts \
-connect developer.download.nvidia.com:443 \
-servername developer.download.nvidia.com </dev/null > ~/nvidia-chain.txt
# Split all PEM blocks to cert-0001.pem, cert-0002.pem, ...
awk 'BEGIN{c=0} /BEGIN CERTIFICATE/{c++} {if(c>0) print > sprintf("cert-%04d.pem", c)}' ~/nvidia-chain.txt
# Identify subjects/issuers
for f in cert-*.pem; do
echo "$f:"; openssl x509 -noout -subject -issuer -in "$f"; echo
done
# Typically:
# - cert-0002.pem subject=... CN=zia.corp.company.org (INTERMEDIATE)
# - cert-0003.pem subject=... CN=RTNetworkSecurityTrust (ROOT)
sudo cp cert-0002.pem /usr/local/share/ca-certificates/rt-intermediate.crt
sudo cp cert-0003.pem /usr/local/share/ca-certificates/rt-root.crt
sudo update-ca-certificates
#### intall the certificate for the cuda repo ####
# Install the NVIDIA keyring package for WSL-Ubuntu x86_64
sudo dpkg -i cuda-keyring_1.1-1_all.deb
# Add ONLY the WSL CUDA repo, referencing the installed keyring
echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] \
https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/ /" \
| sudo tee /etc/apt/sources.list.d/cuda-wsl-ubuntu.list
sudo apt-get clean
sudo apt-get update
#### install cuda toolkit ####
# Latest toolkit meta-package
sudo apt-get install -y cuda-toolkit
#### verify installation ####
nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 590.51 Driver Version: 591.64 CUDA Version: 13.1 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA RTX PRO 4000 Blac... On | 00000000:30:00.0 Off | Off |
| N/A 48C P0 30W / 127W | 0MiB / 16303MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+