Install Cuda 12.1 following instruction but ended up 12.2 was installed

I need to setup an environment to run mmcv in which it requires a cuda12.1 + torch 2.1.x environment.

I have an Jetson Orin Nano 4GB and I purposefully use the SDK Manager only to flash Jetpack 6.0DP WITHOUT any runtime component and SDK component (As I believe Jetpack 6.0 + SDK will install CUDA 12.2 which I cannot use with above use case).

I went to https://developer.nvidia.com/cuda-12-1-0-download-archive and follow the instruction but I still ended up having CUDA 12.2 installed.

This is the instructions generated by above:

Please ensure your device is configured per the CUDA Tegra Setup Documentation.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/arm64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda-tegra-repo-ubuntu2004-12-1-local_12.1.0-1_arm64.deb
sudo dpkg -i cuda-tegra-repo-ubuntu2004-12-1-local_12.1.0-1_arm64.deb
sudo cp /var/cuda-tegra-repo-ubuntu2004-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

Here’s nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:08:11_PDT_2023
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0

Here’s ls /usr/local/cuda* -lah

lrwxrwxrwx 1 root root 22 Mar 19 02:47 /usr/local/cuda → /etc/alternatives/cuda
lrwxrwxrwx 1 root root 25 Mar 19 02:47 /usr/local/cuda-12 → /etc/alternatives/cuda-12

/usr/local/cuda-12.2:
total 128K
drwxr-xr-x 13 root root 4.0K Mar 19 02:47 .
drwxr-xr-x 11 root root 4.0K Mar 19 02:47 …
drwxr-xr-x 3 root root 4.0K Mar 19 02:47 bin
drwxr-xr-x 2 root root 4.0K Mar 19 02:44 compat
drwxr-xr-x 3 root root 4.0K Mar 19 02:47 compute-sanitizer
drwxr-xr-x 3 root root 4.0K Mar 19 02:46 doc
-rw-r–r-- 1 root root 160 Aug 16 2023 DOCS
-rw-r–r-- 1 root root 61K Aug 16 2023 EULA.txt
drwxr-xr-x 4 root root 4.0K Mar 19 02:47 extras
drwxr-xr-x 4 root root 4.0K Mar 19 02:47 gds
lrwxrwxrwx 1 root root 29 Aug 16 2023 include → targets/aarch64-linux/include
lrwxrwxrwx 1 root root 25 Aug 16 2023 lib64 → targets/aarch64-linux/lib
drwxr-xr-x 3 root root 4.0K Mar 19 02:47 nvml
drwxr-xr-x 6 root root 4.0K Mar 19 02:45 nvvm
-rw-r–r-- 1 root root 524 Aug 16 2023 README
lrwxrwxrwx 1 root root 25 Aug 16 2023 res → targets/aarch64-linux/res
drwxr-xr-x 3 root root 4.0K Mar 19 02:47 share
drwxr-xr-x 3 root root 4.0K Mar 19 02:44 targets
drwxr-xr-x 2 root root 4.0K Mar 19 02:47 tools
-rw-r–r-- 1 root root 2.4K Aug 31 2023 version.json

And here’s sudo apt-cache show nvidia-jetpack

Package: nvidia-jetpack
Version: 6.0-b52
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.0-b52), nvidia-jetpack-dev (= 6.0-b52)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.0-b52_arm64.deb
Size: 29294
SHA256: 01f3cfaed6f45ebabacbe5f2d4c3b74a296200ae928d68b97956470d54c4be98
SHA1: 950626b2b51381650e8ecb7e3b21f5e2e89cddb6
MD5sum: 1e58b6faa4b7a9695a1f5b0cb6035d85
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

How can I install CUDA 12.1? I have already flashed the board 5 times trying to setup an environment to run some demo code…

It’s also very frustrating as I tried to fall back to mmpose’s less updated requirments with CUDA 11.8 + PyTorch 2.1 but JetPack 5.1.2 has CUDA 11.4 (which I can install CUDA 11.8, but there’s no more cuDNN archive for CUDA 11.x)