Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: revive nvidia builds #152

Merged
merged 2 commits into from
Sep 23, 2023
Merged
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
39 changes: 38 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,45 @@ jobs:
strategy:
fail-fast: false
matrix:
image_name: [silverblue, kinoite, vauxite, sericea, base, lxqt, mate]
image_name:
- silverblue
- kinoite
- sericea
- onyx
- base
- lxqt
- mate
- vauxite
#major_version: [37, 38, 39]
major_version: [37, 38]
driver_version: [470, 535]
include:
- major_version: 37
is_latest_version: false
is_stable_version: true
is_gts_driver: false
- major_version: 38
is_latest_version: true
is_stable_version: true
is_gts_driver: true
- driver_version: 535
is_latest_driver: true
#- major_version: 39
# is_latest_version: true
# is_stable_version: false
# is_gts_version: false
exclude:
# There is no Fedora 37 version of sericea
# When F38 is added, sericea will automatically be built too
- image_name: sericea
major_version: 37
# There is no Fedora 37 or 38 version of onyx
- image_name: onyx
major_version: 37
- image_name: onyx
major_version: 38
- image_name: vauxite
major_version: 39
steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
Expand Down Expand Up @@ -87,6 +109,12 @@ jobs:
BUILD_TAGS+=("latest")
fi

if [[ "${{ matrix.is_gtst_version }}" == "true" ]] && \
[[ "${{ matrix.is_latest_driver }}" == "true" ]]; then
BUILD_TAGS+=("gts-${TIMESTAMP}")
BUILD_TAGS+=("gts")
fi

if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Generated the following commit tags: "
for TAG in "${COMMIT_TAGS[@]}"; do
Expand Down Expand Up @@ -192,3 +220,12 @@ jobs:
if: github.event_name != 'pull_request'
run: |
echo "${{ toJSON(steps.push.outputs) }}"

check:
name: Check all builds successful
runs-on: ubuntu-latest
needs: [push-ghcr]
steps:
- name: Exit
shell: bash
run: exit 0
17 changes: 9 additions & 8 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${IMAGE_NAME}-main"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION}
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS nvidia

ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-535}"

COPY install.sh /tmp/install.sh
COPY post-install.sh /tmp/post-install.sh

COPY --from=ghcr.io/ublue-os/akmods-nvidia:${FEDORA_MAJOR_VERSION}-${NVIDIA_MAJOR_VERSION} /rpms /tmp/akmods-rpms

RUN /tmp/install.sh
RUN /tmp/post-install.sh
RUN rm -rf /tmp/* /var/*
RUN ostree container commit
RUN mkdir -p /var/tmp && chmod -R 1777 /tmp /var/tmp
RUN /tmp/install.sh && \
/tmp/post-install.sh && \
rm -rf /tmp/* /var/*

RUN ostree container commit && \
mkdir -p /var/tmp && chmod -R 1777 /tmp /var/tmp
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Nvidia

This repository has served it's purpose. We salute your service to the Linux desktop.
[![build-ublue](https://github.com/ublue-os/nvidia/actions/workflows/build.yml/badge.svg)](https://github.com/ublue-os/nvidia/actions/workflows/build.yml)

These images are now being built out of [ublue-os/akmods](https://github.com/ublue-os/akmods) and [ublue-os/main](https://github.com/ublue-os/main).
The purpose of these images is to provide [community Fedora images](https://github.com/ublue-os/main) with Nvidia drivers built-in. This approach can lead to greater reliability as failures can be caught at the build level instead of the client machine. This also allows for individual sets of images for each series of Nvidia drivers, allowing users to remain current with their OS but on an older, known working driver. Performance regression with a recent driver update? Reboot into a known-working driver after one command. That's the goal!

# Documentation

- [Main website and documentation](https://universal-blue.org)
- [Documentation for these images](https://universal-blue.org/images/nvidia)
- [Installation](https://universal-blue.org/installation/) - follow this for clean installation
- [Rebase instructions](https://universal-blue.org/images/) - follow this if you want to switch to another image.
18 changes: 17 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

set -ouex pipefail

sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-{cisco-openh264,modular,updates-modular}.repo
if [[ "${FEDORA_MAJOR_VERSION}" -le 38 ]]; then
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-{cisco-openh264,modular,updates-modular}.repo
else
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-cisco-openh264.repo
fi

# force use of single rpmfusion mirror
sed -i.bak 's%^metalink=%#metalink=%' /etc/yum.repos.d/rpmfusion-*.repo
sed -i 's%^#baseurl=http://download1.rpmfusion.org%baseurl=http://mirrors.ocf.berkeley.edu/rpmfusion%' /etc/yum.repos.d/rpmfusion-*.repo
# after F39 launches, bump to 40
if [[ "${FEDORA_MAJOR_VERSION}" -ge 39 ]]; then
sed -i 's%free/fedora/releases%free/fedora/development%' /etc/yum.repos.d/rpmfusion-*.repo
fi

rpm-ostree install \
/tmp/akmods-rpms/ublue-os/ublue-os-nvidia-addons-*.rpm
Expand All @@ -19,5 +31,9 @@ fi

rpm-ostree install \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-{,cuda-,devel-,kmodsrc-,power-}${NVIDIA_FULL_VERSION} \
xorg-x11-drv-${NVIDIA_PACKAGE_NAME}-libs.i686 \
nvidia-container-toolkit nvidia-vaapi-driver supergfxctl ${VARIANT_PKGS} \
/tmp/akmods-rpms/kmods/kmod-${NVIDIA_PACKAGE_NAME}-${KERNEL_VERSION}-${NVIDIA_AKMOD_VERSION}.fc${RELEASE}.rpm

# reset forced use of single rpmfusion mirror
rename -v .repo.bak .repo /etc/yum.repos.d/rpmfusion-*repo.bak