alpine-overlay/v3.16/nvidia-gpu-driver/APKBUILD

53 lines
2.2 KiB
Plaintext

# Contributor: Stefan Reimer <stefan@zero-downtime.net>
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
pkgname=nvidia-gpu-driver
pkgver=515.65.01
pkgrel=0
pkgdesc="NVIDIA Linux open GPU kernel modules incl. GSP firmware"
url="https://github.com/NVIDIA/open-gpu-kernel-modules"
arch="x86_64"
license="MIT OR GPL-2.0"
makedepends="bash linux-headers linux-virt-dev xz"
options="!check !strip !tracedeps"
source="nvidia-$pkgver.tar.gz::https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/$pkgver.tar.gz
NVIDIA-Linux-x86_64-$pkgver.run::https://download.nvidia.com/XFree86/Linux-x86_64/$pkgver/NVIDIA-Linux-x86_64-$pkgver.run"
builddir="$srcdir/open-gpu-kernel-modules-$pkgver"
build() {
# Hack running the build inside a container other uname -r returns host kernel
KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-virt))
make KERNEL_UNAME=$KERNEL_VERSION
}
package() {
KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-virt))
depends="glibc<2.35 linux-virt=~$(echo $KERNEL_VERSION | sed -e 's/-.*$//')"
modules="nvidia.ko \
nvidia-drm.ko \
nvidia-modeset.ko \
nvidia-uvm.ko \
nvidia-peermem.ko"
mkdir -p "$pkgdir"/lib/modules/$KERNEL_VERSION/kernel
for m in $modules; do
gzip -9 -c kernel-open/$m > "$pkgdir"/lib/modules/$KERNEL_VERSION/kernel/$m.gz
done
# Add gsp firmware see: https://download.nvidia.com/XFree86/Linux-x86_64/$pkgver/README/gsp.html
mkdir -p "$pkgdir"/lib/firmware/nvidia/"$pkgver"
sh "$srcdir"/NVIDIA-Linux-x86_64-$pkgver.run -x -s && cp NVIDIA-Linux-x86_64-$pkgver/firmware/gsp.bin "$pkgdir"/lib/firmware/nvidia/"$pkgver"/gsp.bin
# Install basic nvidia-smi inck. libnvidia-ml
mkdir -p "$pkgdir"/usr/lib "$pkgdir"/usr/sbin
cp NVIDIA-Linux-x86_64-$pkgver/libnvidia-ml.so."$pkgver" "$pkgdir"/usr/lib/libnvidia-ml.so.1
cp NVIDIA-Linux-x86_64-$pkgver/nvidia-smi "$pkgdir"/usr/sbin/nvidia-smi
}
sha512sums='
c2ff6fd02272b6981a65e7e14c6b636f0113e21da910898c27682f58e60fa8e6deea3670081c57e4961fb5e7794eef8eddb90d134ba1892536a8468c5dc9d669 nvidia-515.65.01.tar.gz
5221a4ac071eb39a37a841f19cfe4983286dc35e918956b40604404ef36c122612475df7b9a391a9a70bd60f44e598c8a0e5ec54ccc3e90d51f01e1b2fbe5e33 NVIDIA-Linux-x86_64-515.65.01.run
'