From d91103b5ea9412b763ecc5fdb717be8cf286c62d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Feb 2021 11:48:12 -0500 Subject: [PATCH] notes and additions for running with 468 kernel --- Dockerfile468 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 24 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 Dockerfile468 diff --git a/Dockerfile468 b/Dockerfile468 new file mode 100644 index 0000000..e43c849 --- /dev/null +++ b/Dockerfile468 @@ -0,0 +1,66 @@ +FROM registry.access.redhat.com/ubi8/ubi:8.2 + +COPY .pem /etc/pki/entitlement/ + +COPY -key.pem /etc/pki/entitlement/ + +COPY rhsm.conf /etc/rhsm/ + +RUN rm -f /etc/yum.repos.d/ubi.repo + +COPY redhat.repo /etc/yum.repos.d/ + +ARG DRIVER_VERSION +ENV DRIVER_VERSION=${DRIVER_VERSION:-440.64.00} + +ARG BASE_URL +ENV BASE_URL=${BASE_URL:-https://us.download.nvidia.com/tesla} + +ARG PUBLIC_KEY +ENV PUBLIC_KEY=${PUBLIC_KEY:-empty} + +ARG PRIVATE_KEY + +ARG KERNEL_VERSION +ENV KERNEL_VERSION=${KERNEL_VERSION:-4.18.0-147.3.1.el8_1.x86_64} + + +COPY nvidia-driver-disconnected /usr/local/bin/nvidia-driver-disconnected + +RUN dnf install --releasever=8.2 --setopt tsflags=nodocs -y ca-certificates curl gcc glibc.i686 make cpio kmod \ + elfutils-libelf elfutils-libelf-devel \ + "kernel-headers-${KERNEL_VERSION}" "kernel-devel-${KERNEL_VERSION}" \ + && rm -rf /var/cache/yum/* + +RUN curl -fsSL -o /usr/local/bin/donkey https://github.com/3XX0/donkey/releases/download/v1.1.0/donkey \ + && curl -fsSL -o /usr/local/bin/extract-vmlinux https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux \ + && chmod +x /usr/local/bin/donkey /usr/local/bin/extract-vmlinux + +RUN ln -s /sbin/ldconfig /sbin/ldconfig.real \ + && chmod +x /usr/local/bin/nvidia-driver-disconnected \ + && ln -sf /usr/local/bin/nvidia-driver-disconnected /usr/local/bin/nvidia-driver + +RUN cd /tmp \ + && curl -fSsl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run \ + && sh NVIDIA-Linux-x86_64-$DRIVER_VERSION.run -x \ + && cd NVIDIA-Linux-x86_64-$DRIVER_VERSION \ + && ./nvidia-installer --silent --no-kernel-module --install-compat32-libs --no-nouveau-check --no-nvidia-modprobe \ + --no-rpms --no-backup --no-check-for-alternate-installs --no-libglx-indirect --no-install-libglvnd --x-prefix=/tmp/null \ + --x-module-path=/tmp/null --x-library-path=/tmp/null --x-sysconfig-path=/tmp/null \ + && mkdir -p /usr/src/nvidia-$DRIVER_VERSION \ + && mv LICENSE mkprecompiled kernel /usr/src/nvidia-$DRIVER_VERSION \ + && sed '9,${/^\(kernel\|LICENSE\)/!d}' .manifest > /usr/src/nvidia-$DRIVER_VERSION/.manifest \ + && rm -rf /tmp/* \ + && dnf --releasever=8.2 download -y kernel-core-${KERNEL_VERSION} --downloaddir=/tmp/ \ + && rm -rf /var/cache/yum + +WORKDIR /usr/src/nvidia-$DRIVER_VERSION + +COPY ${PUBLIC_KEY} kernel/pubkey.x509 + +RUN mkdir -p /run/nvidia \ + && touch /run/nvidia/nvidia-driver.pid + +# This will really run the disconnected version +ENTRYPOINT ["nvidia-driver","init"] + diff --git a/README.md b/README.md index 7de3e21..aae0cd7 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,27 @@ Note: The container cannot be built in an air-gapped / disconnected environment. | 4.5.6-x86_64 | 4.18.0-193.14.3.el8_2.x86_64 | | 4.6.1-x86_64 | 4.18.0-193.24.1.el8_2.dt1.x86_64 | | 4.6.8-x86_64 | 4.18.0-193.29.1.el8_2.x86_64 | + +## Note the following for kernel of 4.6.8 + +1. you need to have the following repositories enabled on your RHEL 8.2 system + +``` +rhel-8-for-x86_64-baseos-eus-rpms +rhel-8-for-x86_64-baseos-rpms +rhocp-4.6-for-rhel-8-x86_64-rpms +rhel-8-for-x86_64-appstream-rpms +``` + +2. Set the release to 8.2 +``` +subscription-manager release --set=8.2 +``` +3. Copy the following files to this directory +``` +/etc/pki/entitlement/<>.pem and <>-key.pem files +/etc/yum.repos.d/redhat.repo +/etc/rhsm/rhsm.conf +``` + +4. Update the Dockerfile468 with the files you copied in last step and run using this file