Enable GPU on Container

We have been using this approach to install nvidia drivers inside the containers - NVIDIA drivers on Intel Nuc

But current HOST OS version(balenaOS 2.50.1+rev1) doesn’t seem to support nvidia-driver-435 any more.

FROM balenalib/%%BALENA_MACHINE_NAME%%-ubuntu-python:3.6-bionic-build

ENV RESINOS_VERSION=2.50.1%2Brev1.prod
ENV DEBIAN_FRONTEND=noninteractive
ENV YOCTO_VERSION=5.2.10

RUN wget https://files.resin.io/images/intel-nuc/${RESINOS_VERSION}/kernel_modules_headers.tar.gz
RUN tar -xf kernel_modules_headers.tar.gz && rm -rf kernel_modules_headers.tar.gz
RUN mkdir -p /lib/modules/${YOCTO_VERSION}-yocto-standard
RUN mv ./kernel_modules_headers /lib/modules/${YOCTO_VERSION}-yocto-standard/build
RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2
RUN apt-get update && apt-get install -y apt-transport-https
RUN apt-get install -y nvidia-driver-435 libboost-all-dev

ENV UDEV=1
ENV INITSYSTEM on

CMD [ "sleep", "infinity"]

I can’t find /lib/modules/${YOCTO_VERSION}-yocto-standard/build directory though I moved the linux headers in my Dockerfile.
I even tried to mount it as it was read-only and tried to copy header files manually, but it says out of space!

Found these interesting links:


How can I upgrade my balena-supervisor from 11.4.10 to the version that supports io.balena.features.gpu? And maybe I have to update the hostOS from balenaOS 2.50.1+rev1 to the latest?

Cheers.