Skip to content

Commit

Permalink
feat: switch to negativo17 nvidia
Browse files Browse the repository at this point in the history
The different packaging of negativo17's nvidia allows for installing the driver without all the xorg/wayland libraries. This is desirable on our FCOS based, lightweight images.

This uses the new kmod and installs minimal nvidia driver and CUDA
support.
  • Loading branch information
bsherman committed Oct 5, 2023
1 parent 7d0d18b commit c9b80b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
5 changes: 0 additions & 5 deletions main/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-cisco-openh264.repo
# add tailscale repo
curl -L https://pkgs.tailscale.com/stable/fedora/tailscale.repo -o /etc/yum.repos.d/tailscale.repo

## add rpmfusion (needed for nvidia akmods, etc)
#rpm-ostree install \
# https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm \
# https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${RELEASE}.noarch.rpm


#### INSTALL
## install ZFS (and sanoid deps) if tagged
Expand Down
5 changes: 2 additions & 3 deletions nvidia/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ FROM ghcr.io/ublue-os/${IMAGE_NAME}:${PR_PREFIX}${COREOS_VERSION}${ZFS_TAG}

ARG COREOS_VERSION="${COREOS_VERSION:-stable}"
ARG IMAGE_NAME="${IMAGE_NAME:-ucore}"
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-535}"
ARG KMOD_SRC="${KMOD_SRC:-ghcr.io/ublue-os/ucore-kmods:${COREOS_VERSION}}"

ADD build.sh /tmp/build.sh

COPY --from=ghcr.io/ublue-os/ucore-kmods:${COREOS_VERSION} /rpms/kmods/nvidia/ublue*.rpm /tmp/rpms/
COPY --from=ghcr.io/ublue-os/ucore-kmods:${COREOS_VERSION} /rpms/kmods/nvidia/${NVIDIA_MAJOR_VERSION} /tmp/rpms/
COPY --from=${KMOD_SRC} /rpms/kmods/nvidia/ /tmp/rpms/

RUN mkdir -p /var/lib/alternatives \
&& /tmp/build.sh \
Expand Down
12 changes: 8 additions & 4 deletions nvidia/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

set -ouex pipefail

# repo for nvidia builds
curl -sL --output-dir /etc/yum.repos.d --remote-name \
https://negativo17.org/repos/fedora-nvidia.repo

find /tmp/rpms

rpm-ostree install /tmp/rpms/ublue-os-ucore-nvidia-*.rpm
sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/nvidia-container-runtime.repo

source /tmp/rpms/nvidia-vars
cat /tmp/rpms/nvidia-vars

rpm-ostree install \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \
nvidia-container-toolkit \
/tmp/rpms/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm
/tmp/rpms/kmod-nvidia-*.rpm \
nvidia-driver-cuda \
nvidia-container-toolkit

0 comments on commit c9b80b6

Please sign in to comment.