DALI Python Library on Jetson Nano


I am working on porting code from Linux to the Jetson Nano and I have run into some issues with the DALI Python Library. My code relies on Pipeline, ops, and DALIGenericIterator from the nvidia.dali module.

  1. On the NVIDIA website, I read that there is no support for the DALI Python Library on the aarch64 system yet, so I just wanted to confirm that this is true.
  2. If this library is not supported on the Jetson Nano, I was wondering if you know of any alternative libraries that can help me run my code.

Thank you!

Sorry for the late response, we expect to get the questions on GitHub directly.
Yes, that is true that is is not supported yet as we just haven’t tried yet. This GitHub thread discusses the issue with python bindings https://github.com/NVIDIA/DALI/issues/1864. The recent https://github.com/NVIDIA/DALI/pull/2096 should make the build of python binding easier.
What I would recommend is to try on your build DALI is possible. If you need to make any code adjustment we would be more than happy to review and accept any PR.

Thank you so much for getting back to me.

I was able to start building DALI from source, but I ran into this error which I can’t seem to figure out on the final step:

CMake Error at /usr/local/share/cmake-3.13/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler


is not able to compile a simple test program.

It fails with the following output:

Change Dir: /opt/dali/build-docker-Release-36-10_aarch64/CMakeFiles/CMakeTmp

Run Build Command:"/opt/rh/devtoolset-7/root/usr/bin/gmake" "cmTC_5f6de/fast"
/opt/rh/devtoolset-7/root/usr/bin/gmake -f CMakeFiles/cmTC_5f6de.dir/build.make CMakeFiles/cmTC_5f6de.dir/build
gmake[1]: Entering directory '/opt/dali/build-docker-Release-36-10_aarch64/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_5f6de.dir/main.cu.o
/usr/local/cuda/bin/nvcc     -x cu -c /opt/dali/build-docker-Release-36-10_aarch64/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_5f6de.dir/main.cu.o
/usr/local/cuda/bin/nvcc: /usr/local/cuda/bin/nvcc: cannot execute binary file
gmake[1]: *** [CMakeFiles/cmTC_5f6de.dir/build.make:66: CMakeFiles/cmTC_5f6de.dir/main.cu.o] Error 126
gmake[1]: Leaving directory '/opt/dali/build-docker-Release-36-10_aarch64/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:121: cmTC_5f6de/fast] Error 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:27 (project)

– Configuring incomplete, errors occurred!
See also “/opt/dali/build-docker-Release-36-10_aarch64/CMakeFiles/CMakeOutput.log”.
See also “/opt/dali/build-docker-Release-36-10_aarch64/CMakeFiles/CMakeError.log”.

I built CMake from source and now have version 3.15.2. Do you have any pointers on how I can fix this error?

Could you provide the exact reproduction steps that lead you to this error? I mean your environment setup, commands used, etc.

I installed Docker through these instructions: https://docs.docker.com/engine/install/ubuntu/

I also used this guide from the NVIDIA page to compile DALI from source, but I changed the ARCH from x86_64 to aarch64.

I then ran: sudo ./build.sh

To build for any embedded device using the Jetson toolkit you need to follow this guide for the most recent commit in our repository. For 0.23 release commit, you can use this one.
Just changing from x86_64 to aarch6 won’t do.

I tried to follow that guide, but the SDK Manager download is giving me an error message saying the package architecture does not match the system architecture: package architecture (amd64) does not match system (arm64)

I’m not quite sure I’m even downloading the correct file. Do you have the link to the exact download I need?

So far we have a recipe that works when cross-compiling - build on x86 and run on the Jetson. In your case, you need to download packages on the host for the host to be able to cross-compile.

Thank you so much for all the help. I was able to build and compile on x86 by following the NVIDIA instructions.

I’m still a little lost on how to bind and run on the Jetson.

So far we PyThon bindings are not supported on any Jetson platform. To use DALI there you need to use native code - this test shows how to use C++ API. There we are preparing the pipeline in C++, but you can do it in python, serialize, save the serialized string into the file, load, and then pass to the pipeline instance.
What thing that is worth stressing out here, is that we haven’t tested DALI on nano yet, and it is hard to tell if DALI is not too heavy regarding resource utilization for such platform (mainly memory consumption as it is still not as efficient as it could be).