Skip to content

Instantly share code, notes, and snippets.

@ShreyasSkandan
Last active July 12, 2023 02:23
Show Gist options
  • Save ShreyasSkandan/69f727d48f85d34e0e9b26308ade0040 to your computer and use it in GitHub Desktop.
Save ShreyasSkandan/69f727d48f85d34e0e9b26308ade0040 to your computer and use it in GitHub Desktop.
Installing CUDA on Jetson (Manual Installation)
#!/bin/bash
# For latest CUDA 9.0
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/cuda-repo-l4t-9-0-local_9.0.252-1_arm64.deb
# For latest CUDNN 7.0.5
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libcudnn7_7.0.5.13-1+cuda9.0_arm64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libcudnn7-dev_7.0.5.13-1+cuda9.0_arm64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libcudnn7-doc_7.0.5.13-1+cuda9.0_arm64.deb
# For latest OpenCV 3.3.1
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libopencv_3.3.1_t210_arm64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libopencv-dev_3.3.1_t210_arm64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libopencv-python_3.3.1_t210_arm64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2GA/m892ki/JetPackL4T_32_b196/libopencv-samples_3.3.1_t210_arm64.deb
# For host machine CUDA 9.0
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2/pwv346/JetPackL4T_32_b157/cuda-repo-ubuntu1604-9-0-local_9.0.252-1_amd64.deb
# For host machine OpenCV 3.3.1
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2/pwv346/JetPackL4T_32_b157/libopencv_3.3.1_amd64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2/pwv346/JetPackL4T_32_b157/libopencv-dev_3.3.1_amd64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2/pwv346/JetPackL4T_32_b157/libopencv-python_3.3.1_amd64.deb
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/3.2/pwv346/JetPackL4T_32_b157/libopencv-samples_3.3.1_amd64.deb
#!/bin/bash
# Setup CUDA 8.0 on TX2
# Step 1: Download Jetpack from https://developer.nvidia.com/embedded/jetpack
# Step 2: Extract contents of installer
bash JetPack-L4T-3.1-linux-x64.run --noexec
# Step 3: Run Chooser to generate a repository.json file
./Chooser
# Step 4: Inside the JSON file, you will find the link to a debian installer of arm64 cuda!
# -- Download said version of CUDA
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/006/linux-x64/cuda-repo-l4t-8-0-local_8.0.34-1_arm64.deb
# Step 5: Install CUDA 8.0 using dpkg -i
sudo dpkg -i cuda-repo-l4t-8-0-local_8.0.34-1_arm64.deb
sudo apt update
sudo apt search cuda
# Step 6: You should see cuda-toolkit-8.0 and a bunch of other related libraries
sudo apt install cuda-toolkit-8.0
# Step 7: You can also install the CUDA Samples to sanity check your installer
sudo apt install cuda-samples-8.0
# Step 8: Export PATH and LD_LIBRARY variables
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# Step 9: Install CUDA Samples
# -- go to directory in which you want to install samples and run,
cuda-install-samples-8.0.sh .
# Step 10: Run deviceQuery
cd NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery/
make
./deviceQuery
# You should see Result = PASS
# Other: CUDNN 5.1
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/006/linux-x64/cuDNN-v5.1.zip
# Other: OpenCV 2.4
wget http://developer.download.nvidia.com/devzone/devcenter/mobile/jetpack_l4t/006/linux-x64/libopencv4tegra-repo_2.4.13-17-g5317135_arm64_l4t-r24.deb
# Check your CUDA and CUDNN installation
ldconfig -p | grep cu and grep dnn
# Check your OpenCV installation
dpkg --list | grep opencv
@akrolic
Copy link

akrolic commented Jan 6, 2023

Welcome to the embedded compute life. I'm fairly certain most or all of these files can be obtained now using the jetpack installer from Nvidia. You have to first download the files using a host PC and then everything gets installed onto the target device. The files get deleted afterwards from your machine, but you can grab them between steps and set them aside to try and install thing manually. Its a pain but I mean its a RISC machine so... compiling things is not so trivial

@tiagodavi
Copy link

haha thank you. I am using balena to control devices remotely and turns out balena replaces the regular jetpack with its balena OS what makes everything harder!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment