From b4c3b005aa76d5b013aa56a968cfa4085db9e1f2 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:41:39 +0200 Subject: [PATCH 1/7] gpu: Dockerfile: update balenaOS version Update from 2.107.8+rev1 to 6.5.34+rev5 Change-type: minor Signed-off-by: Alex Gonzalez --- gpu/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 7188780..3fead9c 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -5,11 +5,11 @@ WORKDIR /usr/src ENV DEBIAN_FRONTEND noninteractive # Set some variables to download the proper header modules -ENV VERSION="2.107.8%2Brev1" -ENV BALENA_MACHINE_NAME="genericx86-64-ext" +ENV VERSION="6.5.34%2Brev5" +ENV BALENA_MACHINE_NAME="generic-amd64" # Set variables for the Yocto version of the OS -ENV YOCTO_VERSION=5.10.43 +ENV YOCTO_VERSION=6.6 ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard # Set variables to download proper NVIDIA driver From 31d109d9df0a03a89965856e1e984d7566b4b160 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:42:29 +0200 Subject: [PATCH 2/7] gpu: Dockerfile: fix kernel modules headers file name This has changed in newer balenaOS releases. Change-type: patch Signed-off-by: Alex Gonzalez --- gpu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 3fead9c..d392e90 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,7 +27,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Download the kernel source then prepare kernel source to build a module. RUN \ - curl -fsSL "https://files.balena-cloud.com/images/${BALENA_MACHINE_NAME}/${VERSION}/kernel-modules-headers.tar.gz" \ + curl -fsSL "https://files.balena-cloud.com/images/${BALENA_MACHINE_NAME}/${VERSION}/kernel_modules_headers.tar.gz" \ | tar xz --strip-components=2 && \ make -C build modules_prepare -j"$(nproc)" From c4324b5852331227abbf61c6667f4128b5b98a1c Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:43:24 +0200 Subject: [PATCH 3/7] gpu: Dockerfile: update driver version Also, make sure to use an up to date keyring. Change-type: minor Signed-off-by: Alex Gonzalez --- gpu/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gpu/Dockerfile b/gpu/Dockerfile index d392e90..b6c7152 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -13,7 +13,7 @@ ENV YOCTO_VERSION=6.6 ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard # Set variables to download proper NVIDIA driver -ENV NVIDIA_DRIVER_VERSION=470.86 +ENV NVIDIA_DRIVER_VERSION=570.153.02 ENV NVIDIA_DRIVER=NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION} # Install some prereqs @@ -36,6 +36,10 @@ RUN install_packages libglvnd-dev WORKDIR /usr/src/nvidia +RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.1-1_all.deb && \ + dpkg -i cuda-keyring_1.1-1_all.deb && \ + rm cuda-keyring_1.1-1_all.deb + # Download and compile NVIDIA driver RUN \ curl -fsSL -O https://us.download.nvidia.com/XFree86/Linux-x86_64/$NVIDIA_DRIVER_VERSION/$NVIDIA_DRIVER.run && \ From ef53105957b62ea06300d578a615d76f00728910 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:44:08 +0200 Subject: [PATCH 4/7] cuda: Dockefile: update kernel version Change-type: patch Signed-off-by: Alex Gonzalez --- cuda/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda/Dockerfile b/cuda/Dockerfile index 1293575..44cc6c8 100644 --- a/cuda/Dockerfile +++ b/cuda/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /usr/src ENV DEBIAN_FRONTEND noninteractive # Set variables for the Yocto version of the OS -ENV YOCTO_VERSION=5.10.43 +ENV YOCTO_VERSION=6.6 ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard # Set variables to download proper NVIDIA driver From 805ec3d2508ab8023288535fe71eb58bdc8c687e Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:44:56 +0200 Subject: [PATCH 5/7] cuda: Dockerfile: use an up to date keyring Change-type: patch Signed-off-by: Alex Gonzalez --- cuda/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cuda/Dockerfile b/cuda/Dockerfile index 44cc6c8..0a36e7c 100644 --- a/cuda/Dockerfile +++ b/cuda/Dockerfile @@ -17,6 +17,10 @@ RUN install_packages git wget unzip build-essential libelf-dev bc libssl-dev bis WORKDIR /usr/src/nvidia +RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.1-1_all.deb && \ + dpkg -i cuda-keyring_1.1-1_all.deb && \ + rm cuda-keyring_1.1-1_all.deb + # Download and compile NVIDIA driver RUN \ curl -fsSL -O https://us.download.nvidia.com/XFree86/Linux-x86_64/$NVIDIA_DRIVER_VERSION/$NVIDIA_DRIVER.run && \ @@ -50,7 +54,6 @@ RUN \ RUN \ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin && \ mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \ - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && \ add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" && \ apt-get update && \ apt-get -y install cuda From 6eedb3774c2e5d0303546ce98429815925fb3165 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:45:39 +0200 Subject: [PATCH 6/7] cuda: Dockerfile: update driver version Change-type: patch Signed-off-by: Alex Gonzalez --- cuda/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cuda/Dockerfile b/cuda/Dockerfile index 0a36e7c..b22db6d 100644 --- a/cuda/Dockerfile +++ b/cuda/Dockerfile @@ -9,7 +9,7 @@ ENV YOCTO_VERSION=6.6 ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard # Set variables to download proper NVIDIA driver -ENV NVIDIA_DRIVER_VERSION=470.86 +ENV NVIDIA_DRIVER_VERSION=570.153.02 ENV NVIDIA_DRIVER=NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION} # Install some prereqs From f4a3db687b6a29ac7dae4345dc57e6ad617a266a Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 10 Jun 2025 20:46:26 +0200 Subject: [PATCH 7/7] cuda: Dockerfile: update samples On newer versions of CUDA the examples have been moved out of the main package. Change-type: minor Signed-off-by: Alex Gonzalez --- cuda/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cuda/Dockerfile b/cuda/Dockerfile index b22db6d..9ec8186 100644 --- a/cuda/Dockerfile +++ b/cuda/Dockerfile @@ -13,7 +13,7 @@ ENV NVIDIA_DRIVER_VERSION=570.153.02 ENV NVIDIA_DRIVER=NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION} # Install some prereqs -RUN install_packages git wget unzip build-essential libelf-dev bc libssl-dev bison flex software-properties-common libglvnd-dev +RUN install_packages git wget unzip build-essential libelf-dev bc libssl-dev bison flex software-properties-common libglvnd-dev cmake WORKDIR /usr/src/nvidia @@ -58,12 +58,13 @@ RUN \ apt-get update && \ apt-get -y install cuda -ENV PATH="/usr/local/cuda-11.5/bin:$PATH" -ENV LD_LIBRARY_PATH="/usr/local/cuda-11.5/lib64:$LD_LIBRARY_PATH" +ENV PATH="/usr/local/cuda-12.1/bin:$PATH" +ENV LD_LIBRARY_PATH="/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH" # Compile one CUDA sample application RUN \ - cd /usr/local/cuda-11.5/samples/1_Utilities/deviceQuery && \ + git clone https://github.com/NVIDIA/cuda-samples.git --branch v12.1 /usr/local/cuda-samples && \ + cd /usr/local/cuda-samples/Samples/1_Utilities/deviceQuery && \ make -j8 WORKDIR /usr/src/app