nvidia-merged/PKGBUILD

439 lines
21 KiB
Text
Raw Permalink Normal View History

# Maintainer: Lily Tsuru <lily.modeco80@protonmail.ch>
# Options
# Use patches for running on 6.1x Linux kernels
# (default true). Set to any other value during makepkg invocation
# to disable the new patches.
[[ -z "${_use_new_patches}" ]] && _use_new_patches="true"
pkgbase='nvidia-merged'
pkgname=('lib32-nvidia-merged-utils' 'lib32-opencl-nvidia-merged' 'nvidia-merged-dkms' 'nvidia-merged-settings' 'nvidia-merged-utils' 'opencl-nvidia-merged' 'vgpu-unlock-rs')
pkgrel=2
arch=('x86_64')
makedepends=('git' 'rust')
url='https://krutavshah.github.io/GPU_Virtualization-Wiki/'
license=('custom')
options=('!strip')
groups=('nvidia-merged')
# version. If the vGPU package version is different,
# it must be specified.
pkgver=535.129.03
_vgpupkgver=${pkgver}
# FIXME: Do we really need to use ${CARCH}? As far as I'm aware
# the vGPU suite is x86_64 only.
_generalpkg="NVIDIA-Linux-${CARCH}-${pkgver}"
_vgpupkg="NVIDIA-Linux-${CARCH}-${_vgpupkgver}-vgpu-kvm"
_patchedpkg="NVIDIA-Linux-${CARCH}-${pkgver}-merged-vgpu-kvm-patched"
# revs for git repos
_patcher_rev="3765eee908858d069e7b31842f3486095b0846b5"
_vgpu_unlock_rev="ba66a6c6eeb16eb8e2d2ec368d6605b974070d4b"
source=(
'0001-Fix-NVIDIA-blob-patch-not-using-BASEDIR.patch'
'0002-vGPU-and-Desktop-in-harmony.patch'
'dkms-conftest-iosys-fix.patch'
'nvidia-iommu-api-fix.patch'
'nvidia-drm-defs-fix.patch'
'nvidia-eventfd-fix.patch'
'nvidia-follow-pfn-reimpl.patch'
'nvidia-smi'
'nvidia-vgpu.conf'
'vgpu_unlock-rs.conf'
'nvidia-drm-outputclass.conf'
'nvidia-utils.sysusers'
'nvidia.rules'
"https://us.download.nvidia.com/XFree86/Linux-${CARCH}/${pkgver}/${_generalpkg}.run"
"file://${_vgpupkg}.run"
"git+https://github.com/VGPU-Community-Drivers/vGPU-Unlock-patcher.git#commit=${_patcher_rev}"
"git+https://github.com/mbilker/vgpu_unlock-rs.git#commit=${_vgpu_unlock_rev}")
sha256sums=('ae6b1cf5cc5e177e5502ebed4b64f058524bf5514e1d6cda911e2966b2749b16'
'a66368ac6e409d002238dc6f5b1833bee1573e65386b0537bbcca9cc130b9d2a'
'594339458c2208936ee12e51de515173801566256983e524d67e1da1081e2260'
'437232dfa868999dd252ee95ee88625fb3e8231c0b705510904b6822512c56ba'
'f1e9e0d4ebbd35d14ef28c79f8ed8a0c22ff5e49765dd42119106f39078b4682'
'a26f0ee66e140be1f93e52ff965da59490a33b13f40c56629071eab2553ce48f'
'bd3f975e4b87bdc5135f4268bb99c6ae9c2719448221e80409bc10bdb9493764'
'eb51808257e7898d37d4575f40ada424cabf5dcad61017dd677ff5a0b25dead4'
'5ea0d9edfcf282cea9b204291716a9a4d6d522ba3a6bc28d78edf505b6dc7949'
'eafb28461fbe8a37cef3121f4b0ad53ad459ba389d9afb91e79c6c8d93ba5ea9'
'be99ff3def641bb900c2486cce96530394c5dc60548fc4642f19d3a4c784134d'
'd8d1caa5d72c71c6430c2a0d9ce1a674787e9272ccce28b9d5898ca24e60a167'
'0e54249a7754b668b436f0f7aa7e95fff68edbb12a93dbee4660e09a8c695f84'
'e6dca5626a2608c6bb2a046cfcb7c1af338b9e961a7dd90ac09bb8a126ff002e'
'2a53940da16c7c8bf001e5da0f53983192f4d09ec84cab713fbb424ac11df743'
'f3363d6cfef99147017329d08bedb81e473af91e7cda06d59576768a5a27b62f'
'5ac78e9c1cd940917c41db74fab893f1181559e9993ab041b07cc82d2c020b60')
create_links() {
# create soname links
find "$pkgdir" -type f -name '*.so*' ! -path '*xorg/*' -print0 | while read -d $'\0' _lib; do
_soname=$(dirname "${_lib}")/$(readelf -d "${_lib}" | grep -Po 'SONAME.*: \[\K[^]]*' || true)
_base=$(echo ${_soname} | sed -r 's/(.*)\.so.*/\1.so/')
[[ -e "${_soname}" ]] || ln -s $(basename "${_lib}") "${_soname}"
[[ -e "${_base}" ]] || ln -s $(basename "${_soname}") "${_base}"
done
}
prepare() {
pushd 'vGPU-Unlock-patcher'
git submodule init
git submodule update
#sed -e 's/if $DO_VGPU; then/if false; then/' -i patch.sh
# apply patches to the patcher (ironic)
git am ${srcdir}/0001-Fix-NVIDIA-blob-patch-not-using-BASEDIR.patch
git am ${srcdir}/0002-vGPU-and-Desktop-in-harmony.patch
popd
vGPU-Unlock-patcher/patch.sh --force-nvidia-gpl-I-know-it-is-wrong --enable-nvidia-gpl-for-experimenting general-merge
cd "${_patchedpkg}"
# patch kernel driver
patch -p1 < ../dkms-conftest-iosys-fix.patch
patch -p1 < ../nvidia-iommu-api-fix.patch
patch -p1 < ../nvidia-drm-defs-fix.patch
[[ "${_use_new_patches}" == "true" ]] && {
echo "Enabling linux 6.1x support patches"
patch -p1 < ../nvidia-eventfd-fix.patch
patch -p1 < ../nvidia-follow-pfn-reimpl.patch
};
bsdtar -xf nvidia-persistenced-init.tar.bz2
sed \
-e "s/__VERSION_STRING/${pkgver}/" \
-e 's/__JOBS/`nproc`/' \
-e 's/__DKMS_MODULES//' \
-e '$iBUILT_MODULE_NAME[0]="nvidia"\
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"\
BUILT_MODULE_NAME[1]="nvidia-uvm"\
DEST_MODULE_LOCATION[1]="/kernel/drivers/video"\
BUILT_MODULE_NAME[2]="nvidia-modeset"\
DEST_MODULE_LOCATION[2]="/kernel/drivers/video"\
BUILT_MODULE_NAME[3]="nvidia-drm"\
DEST_MODULE_LOCATION[3]="/kernel/drivers/video"\
BUILT_MODULE_NAME[4]="nvidia-vgpu-vfio"\
DEST_MODULE_LOCATION[4]="/kernel/drivers/video" \
BUILT_MODULE_NAME[5]="nvidia-peermem"\
DEST_MODULE_LOCATION[5]="/kernel/drivers/video"' \
-e 's/NV_EXCLUDE_BUILD_MODULES/IGNORE_PREEMPT_RT_PRESENCE=1 NV_EXCLUDE_BUILD_MODULES/' \
-i kernel/dkms.conf
}
build() {
cd "${srcdir}/vgpu_unlock-rs"
cargo build -j `nproc` --release
}
package_nvidia-merged-dkms() {
pkgdesc="NVIDIA drivers - module sources; patched for vGPU support w/ Rust unlock & host DRM output"
depends=('dkms' "nvidia-merged-utils=${pkgver}" 'libglvnd')
provides=('NVIDIA-MODULE' 'nvidia-dkms')
conflicts=('nvidia-dkms')
install -d -m755 "${pkgdir}/usr/src"
cp -dr --no-preserve='ownership' "${_patchedpkg}/kernel" "${pkgdir}/usr/src/nvidia-${pkgver}"
echo "blacklist nouveau" | install -D -m644 /dev/stdin "${pkgdir}/usr/lib/modprobe.d/${pkgname}.conf"
echo "nvidia-uvm" | install -D -m644 /dev/stdin "${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
install -D -m644 "${_patchedpkg}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}
package_nvidia-merged-utils() {
pkgdesc="NVIDIA drivers utilities; patched for vGPU support w/ Rust unlock & host DRM output"
depends=('xorg-server' 'libglvnd' 'egl-wayland')
optdepends=("nvidia-merged-settings=${pkgver}: configuration tool"
'xorg-server-devel: nvidia-xconfig'
"opencl-nvidia-merged=${pkgver}: OpenCL support"
'mdevctl: mediated device configuration tool'
'libvirt: virtualization engine control interface')
conflicts=('nvidia-libgl' 'nvidia-utils')
provides=('vulkan-driver' 'opengl-driver' 'nvidia-libgl' 'nvidia-utils' 'vgpu_unlock')
replaces=('vgpu_unlock')
pushd ${_patchedpkg}
# X driver
install -Dm755 nvidia_drv.so "${pkgdir}/usr/lib/xorg/modules/drivers/nvidia_drv.so"
# Wayland/GBM
install -Dm755 libnvidia-egl-gbm.so.1* -t "${pkgdir}/usr/lib/"
install -Dm644 15_nvidia_gbm.json "${pkgdir}/usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json"
mkdir -p "${pkgdir}/usr/lib/gbm"
ln -sr "${pkgdir}/usr/lib/libnvidia-allocator.so.${pkgver}" "${pkgdir}/usr/lib/gbm/nvidia-drm_gbm.so"
# firmware
install -Dm644 -t "${pkgdir}/usr/lib/firmware/nvidia/${pkgver}/" firmware/*.bin
# GLX extension module for X
install -Dm755 "libglxserver_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/nvidia/xorg/libglxserver_nvidia.so.${pkgver}"
# Ensure that X finds glx
ln -s "libglxserver_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/nvidia/xorg/libglxserver_nvidia.so.1"
ln -s "libglxserver_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/nvidia/xorg/libglxserver_nvidia.so"
install -Dm755 "libGLX_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/libGLX_nvidia.so.${pkgver}"
# OpenGL libraries
install -Dm755 "libEGL_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/libEGL_nvidia.so.${pkgver}"
install -Dm755 "libGLESv1_CM_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/libGLESv1_CM_nvidia.so.${pkgver}"
install -Dm755 "libGLESv2_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/libGLESv2_nvidia.so.${pkgver}"
install -Dm644 "10_nvidia.json" "${pkgdir}/usr/share/glvnd/egl_vendor.d/10_nvidia.json"
# OpenGL core library
install -Dm755 "libnvidia-glcore.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-glcore.so.${pkgver}"
install -Dm755 "libnvidia-eglcore.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-eglcore.so.${pkgver}"
install -Dm755 "libnvidia-glsi.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-glsi.so.${pkgver}"
# misc
install -Dm755 "libnvidia-api.so.1" "${pkgdir}/usr/lib/libnvidia-api.so.1"
install -Dm755 "libnvidia-fbc.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-fbc.so.${pkgver}"
install -Dm755 "libnvidia-encode.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-encode.so.${pkgver}"
install -Dm755 "libnvidia-cfg.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-cfg.so.${pkgver}"
install -Dm755 "libnvidia-ml.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-ml.so.${pkgver}"
install -Dm755 "libnvidia-glvkspirv.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-glvkspirv.so.${pkgver}"
install -Dm755 "libnvidia-allocator.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-allocator.so.${pkgver}"
install -Dm755 "libnvidia-vulkan-producer.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-vulkan-producer.so.${pkgver}"
# Sigh libnvidia-vulkan-producer.so has no SONAME set so create_links doesn't catch it. NVIDIA please fix!
patchelf --set-soname "libnvidia-vulkan-producer.so.1" "${pkgdir}/usr/lib/libnvidia-vulkan-producer.so.${pkgver}"
# Vulkan ICD
install -Dm644 "nvidia_icd.json" "${pkgdir}/usr/share/vulkan/icd.d/nvidia_icd.json"
install -Dm644 "nvidia_layers.json" "${pkgdir}/usr/share/vulkan/implicit_layer.d/nvidia_layers.json"
# VDPAU
install -Dm755 "libvdpau_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/vdpau/libvdpau_nvidia.so.${pkgver}"
# nvidia-tls library
install -Dm755 "libnvidia-tls.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-tls.so.${pkgver}"
# CUDA
install -Dm755 "libcuda.so.${pkgver}" "${pkgdir}/usr/lib/libcuda.so.${pkgver}"
install -Dm755 "libnvcuvid.so.${pkgver}" "${pkgdir}/usr/lib/libnvcuvid.so.${pkgver}"
install -Dm755 "libcudadebugger.so.${pkgver}" "${pkgdir}/usr/lib/libcudadebugger.so.${pkgver}"
# NVVM Compiler library loaded by the CUDA driver to do JIT link-time-optimization
install -Dm644 "libnvidia-nvvm.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-nvvm.so.${pkgver}"
# PTX JIT Compiler (Parallel Thread Execution (PTX) is a pseudo-assembly language for CUDA)
install -Dm755 "libnvidia-ptxjitcompiler.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-ptxjitcompiler.so.${pkgver}"
# raytracing
install -Dm755 "nvoptix.bin" "${pkgdir}/usr/share/nvidia/nvoptix.bin"
install -Dm755 "libnvoptix.so.${pkgver}" "${pkgdir}/usr/lib/libnvoptix.so.${pkgver}"
install -Dm755 "libnvidia-rtcore.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-rtcore.so.${pkgver}"
# NGX
install -Dm755 nvidia-ngx-updater "${pkgdir}/usr/bin/nvidia-ngx-updater"
install -Dm755 "libnvidia-ngx.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-ngx.so.${pkgver}"
install -Dm755 _nvngx.dll "${pkgdir}/usr/lib/nvidia/wine/_nvngx.dll"
install -Dm755 nvngx.dll "${pkgdir}/usr/lib/nvidia/wine/nvngx.dll"
# Optical flow
install -Dm755 "libnvidia-opticalflow.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-opticalflow.so.${pkgver}"
# Cryptography library wrapper
ls libnvidia-pkcs*
ls *openssl*
install -Dm755 "libnvidia-pkcs11.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-pkcs11.so.${pkgver}"
install -Dm755 "libnvidia-pkcs11-openssl3.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-pkcs11-openssl3.so.${pkgver}"
# Debug
install -Dm755 nvidia-debugdump "${pkgdir}/usr/bin/nvidia-debugdump"
# nvidia-xconfig
install -Dm755 nvidia-xconfig "${pkgdir}/usr/bin/nvidia-xconfig"
install -Dm644 nvidia-xconfig.1.gz "${pkgdir}/usr/share/man/man1/nvidia-xconfig.1.gz"
# nvidia-bug-report
install -Dm755 nvidia-bug-report.sh "${pkgdir}/usr/bin/nvidia-bug-report.sh"
# nvidia-smi
install -Dm644 nvidia-smi.1.gz "${pkgdir}/usr/share/man/man1/nvidia-smi.1.gz"
# nvidia-cuda-mps
install -Dm755 nvidia-cuda-mps-server "${pkgdir}/usr/bin/nvidia-cuda-mps-server"
install -Dm755 nvidia-cuda-mps-control "${pkgdir}/usr/bin/nvidia-cuda-mps-control"
install -Dm644 nvidia-cuda-mps-control.1.gz "${pkgdir}/usr/share/man/man1/nvidia-cuda-mps-control.1.gz"
# nvidia-modprobe
# This should be removed if nvidia fixed their uvm module!
install -Dm4755 nvidia-modprobe "${pkgdir}/usr/bin/nvidia-modprobe"
install -Dm644 nvidia-modprobe.1.gz "${pkgdir}/usr/share/man/man1/nvidia-modprobe.1.gz"
# nvidia-persistenced
install -Dm755 nvidia-persistenced "${pkgdir}/usr/bin/nvidia-persistenced"
install -Dm644 nvidia-persistenced.1.gz "${pkgdir}/usr/share/man/man1/nvidia-persistenced.1.gz"
install -Dm644 nvidia-persistenced-init/systemd/nvidia-persistenced.service.template "${pkgdir}/usr/lib/systemd/system/nvidia-persistenced.service"
sed -i 's/__USER__/nvidia-persistenced/' "${pkgdir}/usr/lib/systemd/system/nvidia-persistenced.service"
# application profiles
install -Dm644 nvidia-application-profiles-${pkgver}-rc "${pkgdir}/usr/share/nvidia/nvidia-application-profiles-${pkgver}-rc"
install -Dm644 nvidia-application-profiles-${pkgver}-key-documentation "${pkgdir}/usr/share/nvidia/nvidia-application-profiles-${pkgver}-key-documentation"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/nvidia-utils/LICENSE"
install -Dm644 README.txt "${pkgdir}/usr/share/doc/nvidia/README"
install -Dm644 NVIDIA_Changelog "${pkgdir}/usr/share/doc/nvidia/NVIDIA_Changelog"
cp -r html "${pkgdir}/usr/share/doc/nvidia/"
ln -s nvidia "${pkgdir}/usr/share/doc/nvidia-utils"
popd
# nvidia-smi (needs patch. see script)
install -D -m755 "${_patchedpkg}/nvidia-smi" "${pkgdir}/usr/lib/nvidia/nvidia-smi.orig"
install -D -m755 "${srcdir}/nvidia-smi" "${pkgdir}/usr/bin/nvidia-smi"
# vGPU files
install -D -m755 "${_patchedpkg}/libnvidia-vgpu.so.${_vgpupkgver}" "${pkgdir}/usr/lib/libnvidia-vgpu.so.${_vgpupkgver}"
install -D -m755 "${_patchedpkg}/libnvidia-vgxcfg.so.${_vgpupkgver}" "${pkgdir}/usr/lib/libnvidia-vgxcfg.so.${_vgpupkgver}"
install -D -m755 "${_patchedpkg}/nvidia-vgpud" "${pkgdir}/usr/bin/nvidia-vgpud"
install -D -m755 "${_patchedpkg}/nvidia-vgpu-mgr" "${pkgdir}/usr/bin/nvidia-vgpu-mgr"
install -D -m644 "${_patchedpkg}/sriov-manage" "${pkgdir}/usr/lib/nvidia/sriov-manage"
install -D -m644 "${_patchedpkg}/vgpuConfig.xml" "${pkgdir}/usr/share/nvidia/vgpu/vgpuConfig.xml"
install -D -m644 "${_patchedpkg}/init-scripts/systemd/nvidia-vgpud.service" "${pkgdir}/usr/lib/systemd/system/nvidia-vgpud.service"
install -D -m644 "${_patchedpkg}/init-scripts/systemd/nvidia-vgpu-mgr.service" "${pkgdir}/usr/lib/systemd/system/nvidia-vgpu-mgr.service"
install -D -m644 "${srcdir}/nvidia-vgpu.conf" "${pkgdir}/usr/lib/systemd/system/libvirtd.service.d/20-nvidia-vgpu.conf"
# distro specific files must be installed in /usr/share/X11/xorg.conf.d
install -D -m644 "${srcdir}/nvidia-drm-outputclass.conf" "${pkgdir}/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf"
install -D -m644 "${srcdir}/nvidia-utils.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
install -D -m644 "${srcdir}/nvidia.rules" "${pkgdir}/usr/lib/udev/rules.d/60-nvidia.rules"
create_links
install -D -m644 "${_patchedpkg}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}
package_vgpu-unlock-rs() {
pkgdesc='vGPU unlock library'
url='https://github.com/mbilker/vgpu_unlock-rs'
arch=('x86_64')
# vgpu_unlock-rs
install -D -m755 "vgpu_unlock-rs/target/release/libvgpu_unlock_rs.so" "${pkgdir}/usr/lib/vgpu_unlock_rs/libvgpu_unlock_rs.so"
# vGPU service overrides (I think it's cleaner to put them in this package. )
install -D -m644 "${srcdir}/vgpu_unlock-rs.conf" "${pkgdir}/usr/lib/systemd/system/nvidia-vgpud.service.d/30-vgpu_unlock-rs.conf"
install -D -m644 "${srcdir}/vgpu_unlock-rs.conf" "${pkgdir}/usr/lib/systemd/system/nvidia-vgpu-mgr.service.d/30-vgpu_unlock-rs.conf"
install -D -m644 "vgpu_unlock-rs/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}
package_nvidia-merged-settings() {
pkgdesc='Tool for configuring the NVIDIA graphics driver (merged)'
url='https://github.com/NVIDIA/nvidia-settings'
arch=('x86_64')
license=('GPL2')
depends=('jansson' 'gtk3' 'libxv' 'libvdpau' 'nvidia-merged-utils' 'libxnvctrl')
# Make sure to conflict with nvidia-settings so we dont fuck up someones shit
conflicts=('nvidia-settings')
install -D -m755 "${_patchedpkg}/nvidia-settings" "${pkgdir}/usr/bin/nvidia-settings"
install -D -m644 "${_patchedpkg}/nvidia-settings.1.gz" "${pkgdir}/usr/share/man/man1/nvidia-settings.1.gz"
install -D -m644 "${_patchedpkg}/libnvidia-gtk2.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-gtk2.so.${pkgver}"
install -D -m644 "${_patchedpkg}/libnvidia-gtk3.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-gtk3.so.${pkgver}"
install -D -m644 "${_patchedpkg}/nvidia-settings.desktop" "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
install -D -m644 "${_patchedpkg}/nvidia-settings.png" "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"
# do the fuck around!!!
sed \
-e 's:__UTILS_PATH__:/usr/bin:' \
-e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
-e 's/__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__/Settings;HardwareSettings;/' \
-e 's/Icon=.*/Icon=nvidia-settings/' \
-i "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
}
package_opencl-nvidia-merged() {
pkgdesc="opencl implemention for nvidia"
depends=('zlib' 'gcc-libs')
optdepends=('opencl-headers: headers necessary for opencl development')
provides=('opencl-driver' 'opencl-nvidia')
conflicts=('opencl-nvidia')
# opencl
install -D -m755 "${_patchedpkg}/libnvidia-opencl.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-opencl.so.${pkgver}"
install -D -m644 "${_patchedpkg}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/license"
}
# multilib
package_lib32-nvidia-merged-utils() {
pkgdesc="NVIDIA drivers utilities; patched for vGPU support w/ Rust unlock & host DRM output (32-bit)"
depends=('lib32-zlib' 'lib32-gcc-libs' 'lib32-libglvnd' "nvidia-merged-utils=${pkgver}")
optdepends=("lib32-opencl-nvidia=${pkgver}")
provides=('lib32-vulkan-driver' 'lib32-opengl-driver' 'lib32-nvidia-libgl' 'lib32-nvidia-utils')
replaces=('lib32-nvidia-libgl')
conflicts=('lib32-nvidia-utils')
pushd "${_patchedpkg}"/32
# Check http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/README/installedcomponents.html
# for hints on what needs to be installed where.
install -D -m755 "libGLX_nvidia.so.${pkgver}" "${pkgdir}/usr/lib32/libGLX_nvidia.so.${pkgver}"
# OpenGL libraries
install -D -m755 "libEGL_nvidia.so.${pkgver}" "${pkgdir}/usr/lib32/libEGL_nvidia.so.${pkgver}"
install -D -m755 "libGLESv1_CM_nvidia.so.${pkgver}" "${pkgdir}/usr/lib32/libGLESv1_CM_nvidia.so.${pkgver}"
install -D -m755 "libGLESv2_nvidia.so.${pkgver}" "${pkgdir}/usr/lib32/libGLESv2_nvidia.so.${pkgver}"
# OpenGL core library
install -D -m755 "libnvidia-glcore.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-glcore.so.${pkgver}"
install -D -m755 "libnvidia-eglcore.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-eglcore.so.${pkgver}"
install -D -m755 "libnvidia-glsi.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-glsi.so.${pkgver}"
# misc
install -D -m755 "libnvidia-fbc.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-fbc.so.${pkgver}"
install -D -m755 "libnvidia-encode.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-encode.so.${pkgver}"
install -D -m755 "libnvidia-ml.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-ml.so.${pkgver}"
install -D -m755 "libnvidia-glvkspirv.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-glvkspirv.so.${pkgver}"
install -D -m755 "libnvidia-allocator.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-allocator.so.${pkgver}"
# VDPAU
install -D -m755 "libvdpau_nvidia.so.${pkgver}" "${pkgdir}/usr/lib32/vdpau/libvdpau_nvidia.so.${pkgver}"
# nvidia-tls library
install -D -m755 "libnvidia-tls.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-tls.so.${pkgver}"
# CUDA
install -D -m755 "libcuda.so.${pkgver}" "${pkgdir}/usr/lib32/libcuda.so.${pkgver}"
install -D -m755 "libnvcuvid.so.${pkgver}" "${pkgdir}/usr/lib32/libnvcuvid.so.${pkgver}"
# PTX JIT Compiler (Parallel Thread Execution (PTX) is a pseudo-assembly language for CUDA)
install -D -m755 "libnvidia-ptxjitcompiler.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-ptxjitcompiler.so.${pkgver}"
# Optical flow
install -D -m755 "libnvidia-opticalflow.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-opticalflow.so.${pkgver}"
popd
create_links
install -D -m644 "${_patchedpkg}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}
package_lib32-opencl-nvidia-merged() {
pkgdesc="opencl implemention for nvidia (32-bit)"
depends=('lib32-zlib' 'lib32-gcc-libs')
optdepends=('opencl-headers: headers necessary for opencl development')
provides=('lib32-opencl-driver' 'lib32-opencl-nvidia')
conflicts=('lib32-opencl-nvidia')
# opencl
install -D -m755 "${_patchedpkg}/32/libnvidia-opencl.so.${pkgver}" "${pkgdir}/usr/lib32/libnvidia-opencl.so.${pkgver}"
create_links
install -D -m644 "${_patchedpkg}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}