Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions cuda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ 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
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
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

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 && \
Expand Down Expand Up @@ -50,17 +54,17 @@ 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

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
Expand Down
14 changes: 9 additions & 5 deletions gpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ 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
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
Expand All @@ -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)"

Expand All @@ -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 && \
Expand Down
Loading