Problem installing libcudnn7-dev_7 on Jetson Nano L4T R32.1

Hey guys,

I have a problem when installing the libcudnn7-dev_7 package on the Jetson Nano.

I’ve started on a fresh Ubuntu 18.04, then installed the following components by getting the download links for the JetPack 4.2 version from the NVIDIA SDK Manager :

  • Nvidia Nano Drivers R32.1.0 (Jetson-210_Linux_R32.1.0_aarch64.tbz2)
  • CUDA 10.0.166 (cuda-repo-l4t-10-0-local-10.0.166_1.0-1_arm64.deb)
  • CUDNN (libcudnn7_7.3.1.28-1+cuda10.0_arm64.deb)

Now when I want to install the libcudnn7-dev_7 package (libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb), the following error occurs:

Preparing to unpack .../libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb ...
Unpacking libcudnn7-dev ( ...
Setting up libcudnn7-dev ( ...
dpkg: error processing package libcudnn7-dev (--install):
 installed libcudnn7-dev package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
The command '/bin/sh -c dpkg -i /tmp/libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb' returned a non-zero code: 1

CUDA seems to be working:

nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sun_Sep_30_21:09:22_CDT_2018
Cuda compilation tools, release 10.0, V10.0.166

Here is the whole Jetpack pipeline in Docker:

# Use Ubuntu 18.04 as a starting point
FROM balenalib/aarch64-ubuntu:cosmic
LABEL io.balena.device-type="jetson-nano"

# Cross-compile on x86-64
RUN [ "cross-build-start" ]

# Install basic packages
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
	less kmod nano net-tools ifupdown iputils-ping i2c-tools usbutils \
	apt-utils dialog bzip2 ca-certificates curl pciutils sudo unp wget

# Install NVIDIA stuff


# Install Nano drivers R32.1.0
RUN sudo apt-get install -y pigz lbzip2
RUN wget -O /usr/sbin/gdrivedl ''
RUN chmod +x /usr/sbin/gdrivedl
RUN gdrivedl xxxxxxxxxxxxxxxxxxxxxx # GDrive file ID outcommented
RUN tar -xvjf /tmp/Jetson-210_Linux_R32.1.0_aarch64.tbz2
RUN chown root /etc/passwd /etc/sudoers /usr/lib/sudo/ /etc/sudoers.d/README
RUN /tmp/Linux_for_Tegra/ -r /

# Install CUDA 10.0.166
RUN gdrivedl xxxxxxxxxxxxxxxxxxxxxx # GDrive file ID outcommented
RUN dpkg -i /tmp/cuda-repo-l4t-10-0-local-10.0.166_1.0-1_arm64.deb
RUN apt-key add /var/cuda-repo-*-local*/*.pub
RUN apt-get -y update && apt-get install -y gnupg
RUN apt-get -y --allow-downgrades install cuda-toolkit-10-0 libgomp1 libfreeimage-dev libopenmpi-dev openmpi-bin
ENV PATH="${PATH}:/usr/local/cuda-10.0/bin"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda-10.0/lib64"

# Install CUDNN
RUN gdrivedl xxxxxxxxxxxxxxxxxxxxxx # GDrive file ID outcommented
RUN gdrivedl xxxxxxxxxxxxxxxxxxxxxx # GDrive file ID outcommented
RUN gdrivedl xxxxxxxxxxxxxxxxxxxxxx # GDrive file ID outcommented
RUN dpkg -i /tmp/libcudnn7_7.3.1.28-1+cuda10.0_arm64.deb 
RUN dpkg -i /tmp/libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb
RUN dpkg -i /tmp/libcudnn7-doc_7.3.1.28-1+cuda10.0_arm64.deb

Any idea what could be wrong?



May I know the reason to install cuDNN manually, is it for the docker environment?
In general, JetPack can install all the packages automatically.

There are some dependency between the package. You will need to install them in the following order:

sudo dpkg -i ~/cudnn/libcudnn7_7.3.1.20-1+cuda10.0_arm64.deb
sudo dpkg -i ~/cudnn/libcudnn7-dev_7.3.1.20-1+cuda10.0_arm64.deb
sudo dpkg -i ~/cudnn/libcudnn7-doc_7.3.1.20-1+cuda10.0_arm64.deb


I am using the ecosystem to update my distributed fleet of embedded devices.

Balena is based on the Docker engine, that’s why I can’t use jetpack. I am aware of the dependencies between the packages. libcudnn7_7 installs fine, libcudnn7-dev fails with above error.

I already tried to reinstall everything from scratch, also using Ubuntu 16.04 instead of 18.04, but same error happened again. Maybe some dependencies are missing. Is it possible to show some more verbose error level to find the reason why the post-installation script fails?

Another user succeeded in doing the same for the Jetson TX2, so in theory it should be possible:

I oriented my template towards his, only catched the right packages from the SDK Manager and uploaded it on GDrive, so I can download them without authentification.

People will keep doing stuff like this so long as Nvidia makes it so difficult to download their software and it’s going to have consequences.

Cudnn is not Photoshop. I can’t pirate it and run on another platform. Cudnn only runs on Nvidia. The only reason to put these files behind authentication it to frustrate developers.

I am currently trying to set up a few devices, using balena as well, and I have to agree, the experience of just getting the environment ready in order to build my project has been rather frustrating so far.

Solved it with a workaround :)

RUN dpkg -i /tmp/libcudnn7-dev_7.3.1.28-1+cuda10.0_arm64.deb; exit 0 
RUN echo "#!/bin/sh\n$(cat /var/lib/dpkg/info/libcudnn7-dev.postinst)" > /var/lib/dpkg/info/libcudnn7-dev.postinst
RUN dpkg --configure libcudnn7-dev