Jetson: Support Nvidia Docker Images

@alanb128

Here is detailed issue we would like to solve.

We were able to install the docker & Nvidia container toolkit inside a service that is running on Jetson Device.

Here is our Docker file:

FROM balenalib/jetson-tx2-ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
# Install CUDA and some utilities
RUN apt-get update && apt-get install -y lbzip2 xorg cuda-toolkit-10-2 wget tar python3 libegl1 python3-gi

# Download and install BSP binaries for L4T 32.4.4
RUN apt-get update && apt-get install -y lbzip2 python3 libegl1 && \
    wget https://developer.nvidia.com/embedded/L4T/r32_Release_v4.4/r32_Release_v4.4-GMC3/T210/Tegra210_Linux_R32.4.4_aarch64.tbz2 && \
    tar xf Tegra210_Linux_R32.4.4_aarch64.tbz2 && \
    cd Linux_for_Tegra && \
    sed -i 's/config.tbz2\"/config.tbz2\" --exclude=etc\/hosts --exclude=etc\/hostname/g' apply_binaries.sh && \
    sed -i 's/install --owner=root --group=root \"${QEMU_BIN}\" \"${L4T_ROOTFS_DIR}\/usr\/bin\/\"/#install --owner=root --group=root \"${QEMU_BIN}\" \"${L4T_ROOTFS_DIR}\/usr\/bin\/\"/g' nv_tegra/nv-apply-debs.sh && \
    sed -i 's/LC_ALL=C chroot . mount -t proc none \/proc/ /g' nv_tegra/nv-apply-debs.sh && \
    sed -i 's/umount ${L4T_ROOTFS_DIR}\/proc/ /g' nv_tegra/nv-apply-debs.sh && \
    sed -i 's/chroot . \//  /g' nv_tegra/nv-apply-debs.sh && \
    ./apply_binaries.sh -r / --target-overlay && cd .. \
    rm -rf Tegra210_Linux_R32.4.4_aarch64.tbz2 && \
    rm -rf Linux_for_Tegra && \
    echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/nvidia-tegra.conf && ldconfig

# Install CuDNN
RUN apt-get install -y libcudnn8 nvidia-cudnn8

RUN apt-get update && apt-get install -y apt-utils dialog aufs-tools gcc libc-dev iptables conntrack unzip

# Install docker.
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release && \
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
    echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
        $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
    apt-get update && apt-get install -y docker-ce

# Install Nvidia Container Toolkit
RUN distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
   && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
RUN apt-get update && apt-get install -y nvidia-docker2
# Enable udevd so that plugged dynamic hardware devices show up in our container.
ENV UDEV=1
ENV INITSYSTEM on

And here is our docker-compose.yml file to support docker inside our service(named sm):

version: '2.1'

volumes:
    docker-data:
services:
  sm:
    build: ./sm
    restart: always
    privileged: true
    network_mode: host
    environment:
      - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
    volumes:
      - 'docker-data:/var/lib/docker'
    labels:
      io.balena.features.supervisor-api: '1'
      io.balena.features.balena-api: '1'
      io.balena.features.kernel-modules: '1'
      io.balena.features.firmware: '1'
      io.balena.features.dbus: '1'
    cap_add:
      - SYS_RAWIO
    ports:
      - "80:80"
    devices:
      - "/dev:/dev"
  • We can run any docker container inside this sm service.
  • Everything is installed on sm service correctly as shown below:
root@balena:/usr/app# head -n 1 /etc/nv_tegra_release
# R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t210ref, EABI: aarch64, DATE: Fri Oct 16 19:44:43 UTC 2020
root@balena:/usr/app# tegrastats 
RAM 2032/7846MB (lfb 16x4MB) SWAP 1/3923MB (cached 0MB) CPU [6%@498,off,off,4%@498,7%@499,3%@499] EMC_FREQ 0%@204 GR3D_FREQ 0%@114 APE 150 PLL@32C MCPU@32C PMIC@100C Tboard@28C GPU@31.5C BCPU@32C thermal@32.1C Tdiode@29C VDD_SYS_GPU 152/152 VDD_SYS_SOC 381/381 VDD_4V0_WIFI 19/19 VDD_IN 1600/1600 VDD_SYS_CPU 152/152 VDD_SYS_DDR 133/133
RAM 2032/7846MB (lfb 16x4MB) SWAP 1/3923MB (cached 0MB) CPU [1%@499,off,off,0%@500,4%@499,0%@499] EMC_FREQ 0%@204 GR3D_FREQ 0%@114 APE 150 PLL@32C MCPU@32C PMIC@100C Tboard@28C GPU@31C BCPU@32C thermal@32.1C Tdiode@29C VDD_SYS_GPU 152/152 VDD_SYS_SOC 381/381 VDD_4V0_WIFI 19/19 VDD_IN 1562/1581 VDD_SYS_CPU 152/152 VDD_SYS_DDR 114/123
root@balena:/usr/app# docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 14
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.140-l4t-r32.4
 Operating System: Ubuntu 18.04.5 LTS (containerized)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.662GiB
 Name: balena
 ID: C726:TCOB:HCPX:323M:WKGK:5EBR:RVPQ:XDKV:3VMX:IYXI:C4R4:4O25
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

But we cannot use --runtime nvidia parameter to launch the nvidia base images:

root@balena:/usr/app# docker run --runtime nvidia --network host -it nvcr.io/nvidia/l4t-tensorflow:r32.4.4-tf2.3-py3
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request: unknown.
ERRO[0000] error waiting for container: context canceled 

Any idea to support GPU-based docker containers?

Cheers,
Shane.

2 Likes

But you can run other, non-nvidia containers in that manner? If you try that same container without the --runtime-nvidia does it actually launch the container? (Granted, I understand it might not be accelerated, but just trying to determine if any container can launch)

@dtischler

Yes, all other containers are running without any issue.

After doing some reading, it appears the --runtime-nvidia attempts to mount the needed paths and devices from the host to the container. On the Ubuntu Jetpack distribution, this works, but in balenaOS (and from there, a container in your case) these might not be available, thus the failure. I am not sure that methodology is going to work now that I have read up a bit on it @scarlyon.

Thanks for your reply, @dtischler

Hmm, how about mounting the paths to the container manually? Like we do in normal balena services?

Which paths are mounted exactly?

Cheers,
Shane.

Tough to say @scarlyon … I can’t seem to get a clear picture from the Nvidia documentation. This post provides a link: What host directories get mounted with --runtime nvidia? - Docker and NVIDIA Docker - NVIDIA Developer Forums

But following the link to GitHub, I cant seem to determine what they are mounting.

Hmm, that’s a good point, @dtischler
Let me try to mount them manually to run the container.

Cheers,
Shane.

Just to add some information to this problem, I’ve successfully exposed graphics devices to containers on balenaOS by adding the following to the appropriate service:

group_add:
  - video
devices:
  - /dev/dri

This is with a GPU using Mesa drivers, however. Nvidia adds additional device nodes, including /dev/nvidia0, /dev/nvidia-modeset, and /dev/nvidia-uvm, etc.

Thanks for your tip!

Will give it a try soon.

Cheers.

@jakogut
Tried your suggestion and it didn’t work… :confused:

@dtischler Do you have any idea to get this issue resolved?

@dtischler @alanb128

As stated here, I tried to mount all paths in the /etc/nvidia-container-runtime/host-files-for-container.d/l4t.csv file, but failed:

root@balena:/usr/app# cat /etc/nvidia-container-runtime/host-files-for-container.d/l4t.csv 
dev, /dev/fb0
dev, /dev/fb1
dev, /dev/nvhost-as-gpu
dev, /dev/nvhost-ctrl
dev, /dev/nvhost-ctrl-gpu
dev, /dev/nvhost-dbg-gpu
dev, /dev/nvhost-gpu
dev, /dev/nvhost-nvdec
dev, /dev/nvhost-nvdec1
dev, /dev/nvhost-prof-gpu
dev, /dev/nvhost-vic
dev, /dev/nvhost-ctrl-nvdla0
dev, /dev/nvhost-ctrl-nvdla1
dev, /dev/nvhost-nvdla0
dev, /dev/nvhost-nvdla1
dev, /dev/nvidiactl
dev, /dev/nvmap
dev, /dev/tegra_dc_0
dev, /dev/tegra_dc_1
dev, /dev/tegra_dc_ctrl
dev, /dev/nvhost-msenc
dev, /dev/nvhost-nvenc1
dev, /dev/nvhost-nvjpg
dir, /lib/firmware/tegra19x
dir, /lib/firmware/tegra18x
dir, /lib/firmware/tegra21x
lib, /usr/lib/aarch64-linux-gnu/libv4l2.so.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/desktop-shell.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/drm-backend.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/EGLWLInputEventExample
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/EGLWLMockNavigation
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/fullscreen-shell.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/gl-renderer.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/hmi-controller.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/ivi-controller.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/ivi-shell.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/LayerManagerControl
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/libilmClient.so.2.2.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/libilmCommon.so.2.2.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/libilmControl.so.2.2.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/libilmInput.so.2.2.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/libweston-6.so.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/libweston-desktop-6.so.0
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/simple-weston-client
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/spring-tool
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/wayland-backend.so
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-calibrator
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-clickdot
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-cliptest
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-content-protection
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-debug
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-desktop-shell
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-dnd
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-eventdemo
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-flower
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-fullscreen
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-image
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-info
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-keyboard
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-launch
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-multi-resource
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-resizor
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-scaler
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-screenshooter
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-simple-dmabuf-egldevice
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-simple-egl
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-simple-shm
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-simple-touch
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-smoke
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-stacking
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-subsurfaces
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-terminal
lib, /usr/lib/aarch64-linux-gnu/tegra/weston/weston-transformed
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvarguscamerasrc.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvdrmvideosink.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglglessink.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvegltransform.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvivafilter.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvjpeg.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvtee.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvv4l2camerasrc.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvidconv.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideocuda.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosink.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosinks.so
lib, /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstomx.so
lib, /usr/lib/aarch64-linux-gnu/libgstnvegl-1.0.so.0
lib, /usr/lib/aarch64-linux-gnu/libgstnvexifmeta.so
lib, /usr/lib/aarch64-linux-gnu/libgstnvivameta.so
lib, /usr/lib/aarch64-linux-gnu/libnvsample_cudaprocess.so
lib, /usr/lib/aarch64-linux-gnu/tegra-egl/ld.so.conf
lib, /usr/lib/aarch64-linux-gnu/tegra-egl/libEGL_nvidia.so.0
lib, /usr/lib/aarch64-linux-gnu/tegra-egl/libGLESv1_CM_nvidia.so.1
lib, /usr/lib/aarch64-linux-gnu/tegra-egl/libGLESv2_nvidia.so.2
lib, /usr/lib/aarch64-linux-gnu/tegra-egl/nvidia.json
lib, /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1.1
lib, /usr/lib/aarch64-linux-gnu/tegra/libdrm.so.2
lib, /usr/lib/aarch64-linux-gnu/tegra/libGLX_nvidia.so.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvapputil.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvargus.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvargus_socketclient.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvargus_socketserver.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvavp.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_fdmap.so.1.0.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurface.so.1.0.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurftransform.so.1.0.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so.1.0.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvcameratools.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvcamerautils.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvcam_imageencoder.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvcamlog.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvcamv4l2.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvcolorutil.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvdc.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvddk_2d_v2.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvddk_vic.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvdsbufferpool.so.1.0.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnveglstream_camconsumer.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnveglstreamproducer.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnveventlib.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvexif.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvfnet.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvfnetstoredefog.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvfnetstorehdfx.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgbm.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_boot.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_camera.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_force.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_generic.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_gpucompute.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_graphics.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_il.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_spincircle.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_tbc.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvgov_ui.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-eglcore.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-egl-wayland.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-fatbinaryloader.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-glcore.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-glsi.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-glvkspirv.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-ptxjitcompiler.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-rmapi-tegra.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvidia-tls.so.32.4.4
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvid_mapper.so.1.0.0
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvimp.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvll.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmedia.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmm_contentpipe.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmmlite_image.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmmlite.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmmlite_utils.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmmlite_video.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmm_parser.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmm.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvmm_utils.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvodm_imager.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvofsdk.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvomxilclient.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvomx.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvosd.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvos.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvparser.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvphsd.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvphs.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvrm_gpu.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvrm_graphics.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvrm.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvscf.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvtestresults.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvtnr.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvtracebuf.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvtvmr.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvv4l2.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvv4lconvert.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvvulkan-producer.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libnvwinsys.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libsensors.hal-client.nvs.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libsensors_hal.nvs.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libsensors.l4t.no_fusion.nvs.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libtegrav4l2.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvvidconv.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvvideocodec.so
lib, /usr/lib/aarch64-linux-gnu/tegra/libvulkan.so.1.2.132
lib, /usr/lib/aarch64-linux-gnu/tegra/nvidia_icd.json
sym, /etc/vulkan/icd.d/nvidia_icd.json
sym, /usr/lib/aarch64-linux-gnu/libcuda.so
sym, /usr/lib/aarch64-linux-gnu/libdrm_nvdc.so
sym, /usr/lib/aarch64-linux-gnu/libv4l2.so.0.0.999999
sym, /usr/lib/aarch64-linux-gnu/libv4lconvert.so.0.0.999999
sym, /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvvidconv.so
sym, /usr/lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvvideocodec.so
sym, /usr/lib/aarch64-linux-gnu/libvulkan.so.1.2
sym, /usr/lib/aarch64-linux-gnu/tegra/libcuda.so
sym, /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurface.so
sym, /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurftransform.so
sym, /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so
sym, /usr/lib/aarch64-linux-gnu/tegra/libnvdsbufferpool.so
sym, /usr/lib/aarch64-linux-gnu/tegra/libnvid_mapper.so
sym, /usr/share/glvnd/egl_vendor.d/10_nvidia.json
lib, /lib/firmware/tegra21x/nvhost_nvdec020_ns.fw

root@balena:/usr/app# docker run --runtime nvidia --network host -it nvcr.io/nvidia/l4t-tensorflow:r32.4.4-tf2.3-py3 -v /dev:/dev -v /lib/firmware:/lib/firmware -v /usr/lib:/usr/lib 
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request: unknown.
ERRO[0001] error waiting for container: context canceled 

Any update here? :slight_smile:

Hey @scarlyon - just got a Jetson Nano Devkit (B01 / the 4 GB version with two CSI connectors) and played a bit around with (in a non-balena way). A friend of mine who knew about my new toy sent me this news this morning: NVIDIA Jetson TX2 NX + Other ARM Platforms Now Supported By Linux 5.15 - Phoronix

I was looking around a bit and quite confused, but it looks like nearly none of the Jetson boards have mainline kernel support. Nvidia is only keeping some infos about how to build the kernel yourself - but did not include it / pressure enough to really get it into the kernel, with the exception of the TX2 NX module in 5.15. A lot of the other modules are still bound to this prepackaged “Jetpack” image with a 4.9 Kernel and some Ubuntu LTS version, which is exactly what your container is also showing:

Kernel Version: 4.9.140-l4t-r32.4
Operating System: Ubuntu 18.04.5 LTS (containerized)

So, the point I am currently asking myself right now is whether there needs to be some kernel level support baked into the Yocto OS / balenaOS to support gpu acceleration and handling this with balena…

There is actually some old post in the forum - but I don’t know if its still current:

Thanks @nmaas87, let us know how you get along with your Nano!

@scarlyon – I just noticed that Nvidia has published a repository of all their .deb files that might be useful, but I haven’t yet looked through it all or wrapped my head around what it will enable. It’s worth checking out here though: https://repo.download.nvidia.com/jetson/#Jetpack%204.5

Hi, mate.
Any update here? What do I have to do to boost this? :slight_smile:

2 Likes

Hi @scarlyon @dtischler, did you get a resolution to this?

Hi folks @dtischler @scarlyon, any solution on this?

I am having the same issue.

Sorry @aktaseren @g.corrigan @scarlyon, no update on this one yet. :neutral_face:

1 Like

@dtischler thank you very much for this quick reply.

So can we say that externally using the GPU of Nvidia Jetson devices hosting BalenaOS is not possible on the deployment of an AI app for now?

Hey guys,
I don’t know if you’re aware of balenas starting guide for Jetson: How to use Nvidia Jetson devices on balena
I actually did try this during our Hackathon today and can happily report that it does works and creates two containers which actually expose e.g. cuda functionality / can run the GPU from the balenaOS containers.

You can use the provided example to build your own containers: GitHub - balena-io-playground/jetson-nano-sample-new: Jetson Nano sample using new packages

Cheers