CUDA 10.1 Installation without Jetpack

Hi everyone,

We have a Jetson TX2 device that has been pre-flushed for us, therefore there are some customized libraries. I realized that the device original installation did not have CUDA installed. After doing some searching, it seems like manual installation is not something that is recommended. We of course cannot re-flush with the SDK manager to get a fresh installation, we would lose a lot of the customized packages and configuration.

Is there a way to install proper CUDA 10.1 without SDK manager? I found some instructions on how to do it, but I am not convinced about trying them, in fear of messing up the device.

If anyone has an official or proper way of installing CUDA it would be great. I am sorry if this is a duplicate topic, I found one from 2018 but I am hoping that with later Jetpack releases (we are on Jetpack 4.3) there are better ways of doing CUDA installation.

Thank you for your time

Svetlana

Generally speaking, SDK install method is the most reliable, but many people do not realize they can “uncheck” the flash part and just check install of CUDA. There is no need to flash if the SDK Manager/JetPack release software is the same release version as what is on the Jetson. The actual software flashed can be referred to as the L4T release, and one of these will show the release:

head -n 1 /etc/nv_tegra_release
dpkg -l | grep 'nvidia-l4t-core'

You can find a cross-reference to L4T releases and JetPack/SDKM releases here:
https://developer.nvidia.com/linux-tegra
https://developer.nvidia.com/embedded/jetpack-archive

Simply use the correct version, and uncheck everything except installing CUDA. The GUI menus sometimes do not make it obvious many items are selectable. Also, do not put the Jetson in recovery mode and you guarantee it cannot be flashed (optional packages like CUDA do not install until the unit is fully booted).

Also, if the CUDA repository is enabled (and there is a good chance it is), then you can try this to see what is available:

sudo apt update
apt search cuda
# With a pager:
apt search cuda | less -i

If you find something available by apt, then you could simply use the “sudo apt-get install ...package name...”.

FYI, you mention JetPack 4.3, but use the above commands to make sure before you install something from this. The CUDA software has strong dependencies on what is installed for the rest of the o/s.

Since you did not use sdkmanage to build your system you will need to hit up the people that preloaded your system.

They might be able to supply you with a file, the file on my system is nvidia-l4t-cuda_32.3.1-20191209230245_arm64.deb and that can get the lowlevel cuda stuff installed on to your system.

jtop info will tell you what is install/not installed. then you can look in the forums for the dpkg and apt-get install to install cuda. Sorry I just did it on my system, but have lost the link info…

You will end up with /usr/local/cuda and be able to build, I think you need to search for deviceQuery in nvidia forum

I found deviceQuery in /usr/local/cuda/samples/bin/aarch64/linux/release once I got apt-get install to fill in my /usr/local/cuda dir.

Thank God for bash history, to find things done on my system.

Linuxdev has a better memory than I have, that is all the good info.

Good Luck

Hi,

Thank you very much for your replies, I will give a try first to install it from SDK manager (directly from Jetson since its the only system where I have Ubuntu 16.04). I will then try your other suggestions @linuxdev and @terrysu50z.

Thank you once again! I will report back.

Svetlana

if the lib are special look into cloning your device first, then sdk can reinstall your disk image and add stuff

Beware device trees are not cloned, so you might be walking off a cliff, depending on the initial system you have!

Thats a good point, I might do that first!

Thank you

Svetlana

So I managed to get this file ‘nvidia-l4t-cuda_32.3.1-20191209230245_arm64.deb’ by downloading from here:

The L4T driver package. Installation now fails because I am missing a dependency ‘nvidia-l4t-ccp-t186ref’, which I also got from the above archive --> ‘nvidia-l4t-ccp-t186ref_32.3.1-20191209230245_arm64.deb’. However, that fails to install with the following error:

sudo dpkg -i nvidia-l4t-ccp-t186ref_32.3.1-20191209230245_arm64.deb Selecting previously unselected package nvidia-l4t-ccp-t186ref. (Reading database ... 122089 files and directories currently installed.) Preparing to unpack nvidia-l4t-ccp-t186ref_32.3.1-20191209230245_arm64.deb ... L4T Debian install is not supported on your configuration You should install an L4T image from the latest releases - starting from r32.3+ to have Debian package support dpkg: error processing archive nvidia-l4t-ccp-t186ref_32.3.1-20191209230245_arm64.deb (--install): new nvidia-l4t-ccp-t186ref package pre-installation script subprocess returned error exit status 1 Errors were encountered while processing: nvidia-l4t-ccp-t186ref_32.3.1-20191209230245_arm64.deb

Not sure what the problem is, but they are exact packages for TX2…

I gave you that name without understanding your system.

cat /etc/nv_tegra_release tells you the release on your system, you might need to download different files.

I used sudo apt-get install nvidia-l4t-cuda_32.3.1-20191209230245_arm64.deb to load it onto my system, Then I used linuxdev dpgk and pointers to load the rest.

You appear to be moving forward, good luck
Terry

This actually matches my system, the drivers are for TX2 and Jetpack 4.3. They should in theory install. I will try with apt-get, thank you I will let you know how it goes.

Svetlana

Hi again,

I can’t seem to bypass the error about not being able to install ‘nvidia-l4t-ccp’, even if it comes from the proper architecture for TX2 and version.

Does anyone know how I can download jetpack 4.3 without going through SDK manager? I do not have an Ubuntu machine, I only have my Mac and the TX2/Nano where SDK manager will not install.

Thanks in advance

Svetlana

If you mean using an outside host PC to do this, then that should work. If you mean running SDKM directly on a Jetson, then that won’t work. On the other hand, the Jetson itself should succeed with some “apt-get install” commands even without SDKM if the base operating system is already running.

The command line flash software mandates a Linux host PC. The JetPack/SDK Manager software mandates Ubuntu. The GUI is just a front end to the command line flash software. The binary executable which understands a Jetson as a custom USB device when in recovery mode only runs on Linux.

If you are going to work on this, then you might consider setting up dual boot with Ubuntu 18.04.

Yeah my host PC is not Ubuntu, unfortunately…

I am getting nothing relevant with ‘apt search cuda’:

            Sorting... Done
        Full Text Search... Done
        caffe-cpu/bionic 1.0.0-6 arm64
          Fast, open framework for Deep Learning (Meta)

    forge-doc/bionic 0.9.2-2 all
      documentation for forge

    libarrayfire-cpu-dev/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      Development files for ArrayFire (CPU backend)

    libarrayfire-cpu3/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      High performance library for parallel computing (CPU backend)

    libarrayfire-dev/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      Common development files for ArrayFire

    libarrayfire-doc/bionic 3.3.2+dfsg1-4ubuntu1 all
      Common documentation and examples for ArrayFire

    libarrayfire-opencl-dev/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      Development files for ArrayFire (OpenCL backend)

    libarrayfire-opencl3/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      High performance library for parallel computing (OpenCL backend)

    libarrayfire-unified-dev/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      Development files for ArrayFire (unified backend)

    libarrayfire-unified3/bionic 3.3.2+dfsg1-4ubuntu1 arm64
      High performance library for parallel computing (unified backend)

    libcupti-doc/bionic 9.1.85-3ubuntu1 all
      NVIDIA CUDA Profiler Tools Interface documentation

    libforge-dev/bionic 0.9.2-2 arm64
      development files for forge

    libforge0/bionic 0.9.2-2 arm64
      high-performance OpenGL visualization

    librandom123-dev/bionic 1.09+dfsg-1 all
      parallel random numbers library

    librandom123-doc/bionic 1.09+dfsg-1 all
      documentation and examples of parallel random numbers library

    libsuperlu-dist-dev/bionic 5.3.0+dfsg1-1 arm64
      Highly distributed solution of sparse linear equations

    libsuperlu-dist5/bionic 5.3.0+dfsg1-1 arm64
      Highly distributed solution of sparse linear equations

    libthrust-dev/bionic 1.9.1~9.1.85-3ubuntu1 all
      Thrust - Parallel Algorithms Library

    libtrilinos-kokkos-dev/bionic 12.12.1-5 arm64
      Trilinos Kokkos progr`Preformatted text`amming model - development files

    libtrilinos-kokkos12/bionic 12.12.1-5 arm64
      Trilinos Kokkos programming model - runtime files

    numba-doc/bionic 0.34.0-3 all
      native machine code compiler for Python (docs)

    nvidia-cuda-doc/bionic 9.1.85-3ubuntu1 all
      NVIDIA CUDA and OpenCL documentation

    pyrit/bionic 0.4.0-7.1build2 arm64
      GPGPU-driven WPA/WPA2-PSK key cracker

    pyrit-opencl/bionic 0.4.0-1build1 arm64
      OpenCL extension module for Pyrit

    python-arrayfire/bionic 3.3.20160624-2 all
      ArrayFire bindings for Python 2

    python-arrayfire-doc/bionic 3.3.20160624-2 all
      documentation for the ArrayFire Python bindings

    python-numba/bionic 0.34.0-3 arm64
      native machine code compiler for Python 2

    python-pycuda-doc/bionic 2017.1.1-2 all
      module to access Nvidia‘s CUDA computation API (documentation)

    python-pytools/bionic 2017.6-1 all
      big bag of things supplementing Python standard library

    python3-arrayfire/bionic 3.3.20160624-2 all
      ArrayFire bindings for Python 3

    python3-numba/bionic 0.34.0-3 arm64
      native machine code compiler for Python 3

    python3-pytools/bionic 2017.6-1 all
      big bag of things supplementing Python 3 standard library

    suricata/bionic 3.2-2ubuntu3 arm64
      Next Generation Intrusion Detection and Prevention Tool

    vc-dev/bionic 1.3.3-3 arm64
      Library to ease explicit vectorization of C++ code

    vim-syntastic/bionic 3.8.0-1 all
      Syntax checking hacks for vim

I also tried adding the following in my /etc/apt/sources.list.d/nvidia-l4t-apt-source.list :

deb https://repo.download.nvidia.com/jetson/common r32 main
deb https://repo.download.nvidia.com/jetson/t18p r32 main

It gives me an error when I do apt-update, related to the key…

Is it correct that you are running the apt commands from the Jetson itself? If so, then I’ve seen that before, but my information might be a bit out of date and incomplete. Here is an older URL on this (look for the apt repo info):
https://forums.developer.nvidia.com/t/how-to-clone-jetson-nano-sd-card/141235/58

The actual key addition depends on having the key available, and I don’t know where to get that key unless it is already present, and just not registered. Would someone else know of the command for adding the apt key under JetPack 4.3?

Thats correct, I am running the apt command directly from jetson. I am a bit surprised I am getting nothing back, because on the nano I was able to get CUDA 10.0, 10.1, but for TX2 things seem to be different. I will take a look at the thread, thanks again!

It is the same on all Jetsons. What differs is the actual installed L4T release (which is what JetPack/SDKM flashes to the Jetson). This assumes the basic apt repo setup has been completed for the Jetson. What do you see from:
sudo egrep -H -R nvidia /etc/apt/*
(try this both on a system which works, and on a system which does not seem to find the CUDA software and compare)

Your release may differ, but it should show something similar to this (what follows is actually on an NX):

/etc/apt/sources.list.d/nvidia-l4t-apt-source.list:deb https://repo.download.nvidia.com/jetson/common r32.4 main
/etc/apt/sources.list.d/nvidia-l4t-apt-source.list:deb https://repo.download.nvidia.com/jetson/t194 r32.4 main

I see the below:

sudo egrep -H -R nvidia /etc/apt/*
/etc/apt/sources.list.d/nvidia-l4t-apt-source.list:deb https://repo.download.nvidia.com/jetson/common r32.3.1 main
/etc/apt/sources.list.d/nvidia-l4t-apt-source.list:deb https://repo.download.nvidia.com/jetson/t186 r32.3.1 main
Binary file /etc/apt/trusted.gpg matches

Which is what I manually added. Will boot my nano and check there too, will let you know.

Thank you

Hi,

So I finally got it working using the SDK manager, but through a workaround, because I do not have an Ubuntu PC. I hope this helps anyone trying to install CUDA without having to re-flush, and this can be done with any Jetpack and any Jetson device.

I created an AWS instance (Ubuntu 18.04) and installed the SDK manager CLI on it (Good thing there is a CLI version!).

wget https://developer.nvidia.com/nvsdk-manager
sudo apt install ./sdkmanager_1.3.1-7110_amd64.deb 

I ran the SDK manager with the command line specifying the Jetpack version 4.3 (later I was asked to choose my device where I chose TX2).

sudo sdkmanager --cli install --logintype devzone --product Jetson --host --target P3310-1000 --targetos Linux --version 4.3 --additionalsdk DeepStream --flash skip

The following screen appears like the regular SDK manager:

I unchecked everything but CUDA (some stuff I could not uncheck), and it started downloading. I had very little space and CUDA was the first package to be downloaded so I canceled it after CUDA was completed. All packages go to:

/home/ubuntu/Downloads/nvidia/sdkm_downloads/

directory by default. I finally got the *.deb file I needed:

cuda-repo-l4t-10-0-local-10.0.326_1.0-1_arm64.deb

This was good enough to install everything I needed for Jetson TX2 , CUDA 10.0.

Svetlana