Skip to content

Your GeForce runs AI at half speed. This fixes it for 20/30/40 series cards. Up to 2× FP16 / BF16 / TF32 tensor throughput

C

Add a CI workflow

Claude5f4fcc1384fe
diff --git a/.github/ci/module.sh b/.github/ci/module.sh
new file mode 100755
index 0000000..c8a245f
--- /dev/null
+++ b/.github/ci/module.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+# Build the module against the distribution kernel headers of this
+# container, with warnings as errors. Run from the repository root.
+set -eu
+. /etc/os-release
+case "$ID" in
+debian)
+ apt-get update -q
+ apt-get install -qy --no-install-recommends make gcc linux-headers-amd64 ;;
+ubuntu)
+ apt-get update -q
+ apt-get install -qy --no-install-recommends make gcc linux-headers-generic ;;
+fedora)
+ dnf install -qy make gcc kernel-devel ;;
+arch)
+ pacman -Syu --noconfirm --needed make gcc linux-headers ;;
+*)
+ echo "unknown distribution: $ID" >&2
+ exit 1 ;;
+esac
+for kdir in /usr/src/linux-headers-*-amd64 /usr/src/linux-headers-*-generic \
+ /usr/src/kernels/* /usr/lib/modules/*/build; do
+ [ -f "$kdir/Makefile" ] && break
+done
+[ -f "$kdir/Makefile" ] || { echo "no kernel headers found" >&2; exit 1; }
+echo "Building against $kdir"
+make -C kernel/gpu_unlock KDIR="$kdir" KCFLAGS=-Werror
+test -f kernel/gpu_unlock/gpu_unlock.ko
diff --git a/.github/ci/package.sh b/.github/ci/package.sh
new file mode 100755
index 0000000..78d0e7d
--- /dev/null
+++ b/.github/ci/package.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-only
+# Build the native packages of this container's distribution from HEAD,
+# with the pinned inputs already fetched into $INPUTS. Run from the
+# repository root.
+set -eu
+: "${INPUTS:?set INPUTS to the directory make inputs fills}"
+INPUTS=$(realpath "$INPUTS")
+git config --global --add safe.directory "$PWD"
+. /etc/os-release
+case "$ID" in
+debian|ubuntu)
+ apt-get build-dep -qy .
+ make deb INPUTS="$INPUTS"
+ ls build/deb/*.deb ;;
+fedora)
+ dnf builddep -qy packaging/rpm/gpu-unlock.spec
+ make rpm INPUTS="$INPUTS"
+ ls build/rpm/RPMS/noarch/*.rpm ;;
+arch)
+ # makepkg refuses to run as root.
+ useradd -m builder
+ chown -R builder "$PWD" "$INPUTS"
+ su builder -c "git config --global --add safe.directory '$PWD' &&
+ cd packaging/arch && SRCDEST='$INPUTS' makepkg -f --noconfirm"
+ ls packaging/arch/*.pkg.tar.zst ;;
+*)
+ echo "unknown distribution: $ID" >&2
+ exit 1 ;;
+esac
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..e4768f2
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: GPL-2.0-only
+name: CI
+
+on:
+ push:
+ pull_request:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+# The pinned NVIDIA/CachyOS inputs (about 340 MB) are fetched once per
+# manifest change into .inputs and shared by every job through the cache.
+jobs:
+ inputs:
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+ - id: cache
+ uses: actions/cache@v4
+ with:
+ path: .inputs
+ key: inputs-${{ hashFiles('firmware/artifacts-*.json') }}
+ - if: steps.cache.outputs.cache-hit != 'true'
+ run: make inputs INPUTS=.inputs
+ - name: Verify the inputs
+ run: python3 firmware/fetch_artifacts.py --offline .inputs
+
+ # With the generated firmware the tests also run the whole unlock against
+ # mocked hardware, not only the components.
+ test:
+ needs: inputs
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+ - run: sudo apt-get update -q && sudo apt-get install -qy zstd
+ - uses: actions/cache/restore@v4
+ with:
+ path: .inputs
+ key: inputs-${{ hashFiles('firmware/artifacts-*.json') }}
+ fail-on-cache-miss: true
+ - run: make firmware INPUTS=.inputs ASSETS="$RUNNER_TEMP/assets"
+ - run: make test ASSETS="$RUNNER_TEMP/assets"
+
+ module:
+ name: module (${{ matrix.image }})
+ runs-on: ubuntu-24.04
+ container: ${{ matrix.image }}
+ strategy:
+ fail-fast: false
+ matrix:
+ image:
+ - debian:12 # 6.1
+ - ubuntu:24.04 # 6.8
+ - debian:13 # 6.12
+ - fedora:latest
+ - archlinux:latest
+ steps:
+ - uses: actions/checkout@v4
+ - run: sh .github/ci/module.sh
+
+ package:
+ name: package (${{ matrix.image }})
+ needs: inputs
+ runs-on: ubuntu-24.04
+ container: ${{ matrix.image }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - image: debian:13
+ setup: apt-get update -q && apt-get install -qy --no-install-recommends ca-certificates git make xz-utils zstd
+ - image: fedora:latest
+ setup: dnf install -qy git make xz zstd rpm-build dnf-plugins-core
+ - image: archlinux:latest
+ setup: pacman -Syu --noconfirm --needed base-devel git zstd
+ steps:
+ # git before the checkout, so make dist and makepkg can build HEAD;
+ # zstd before the cache restore, which needs it.
+ - run: ${{ matrix.setup }}
+ - uses: actions/checkout@v4
+ - uses: actions/cache/restore@v4
+ with:
+ path: .inputs
+ key: inputs-${{ hashFiles('firmware/artifacts-*.json') }}
+ fail-on-cache-miss: true
+ - run: INPUTS=.inputs sh .github/ci/package.sh
diff --git a/.gitignore b/.gitignore
index ca57e86..99f5e55 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
/workbook/
/scratchpad/
/build/
+/.inputs/
**/__pycache__/
*.pyc
*.ko