From 5c636a121a9064a4373d06b60d49a6f5d67c0e2f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Jul 2023 05:42:53 +0100 Subject: gentoo auto-resync : 25:07:2023 - 05:42:52 --- x11-drivers/nvidia-drivers/Manifest | 6 +- .../nvidia-drivers/nvidia-drivers-525.47.31.ebuild | 500 --------------------- .../nvidia-drivers/nvidia-drivers-525.47.34.ebuild | 500 +++++++++++++++++++++ 3 files changed, 503 insertions(+), 503 deletions(-) delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-525.47.31.ebuild create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-525.47.34.ebuild (limited to 'x11-drivers/nvidia-drivers') diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index 000036c46f3c..b75cd9f3bb95 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -22,7 +22,7 @@ DIST NVIDIA-Linux-x86-390.157.run 49417041 BLAKE2B 435b5e0e60468cc74b41cc5d9b5bb DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a DIST NVIDIA-Linux-x86_64-470.199.02.run 273256770 BLAKE2B 5ceca89da4b4c7de701602d3dbf26e71a1163be26e0e5eac65354ecd40bfc8d68c981a6ef75b13e95079835c95ef7f9e10e5f95a0ed09beffd5bc22cb81a5330 SHA512 e1265b6266473af652e9d7bf85dcd76e312af281c5f4f158ab322e34d378738acb87c30cfff7bf1f6e1b238883e7f665d9fc5151b1e0078dd9aece5a52655405 DIST NVIDIA-Linux-x86_64-525.125.06.run 414318862 BLAKE2B 204c53bbf579edf6d88c9ab4efcf82983a2b58262df4748076de96f3d67b107949407ae0c5ffe9bf6747783b1bcb9a9efc4a3c60d7161427b1c85ecfc494171a SHA512 a5f13b633d111d9dc928e8522cd916a2b756fccbf2dc532649762a3f9bdc5503bd57c9c698da8205c49e82720b45789413a1afc26be77d741f823b49ae2f333d -DIST NVIDIA-Linux-x86_64-525.47.31.run 414430727 BLAKE2B 0e0816336dafe1547d60e1c3d35d178418958e20bc8935716fffb21501b56e30facc08f83b07f295a49347510e9144f223b7adfeb8d5509963b3b6951beefdf6 SHA512 be058626004e5ad7e0df340525c727465600bd557286a1332c5f95d32296fe922ceb7e3590c13ba3b602e6eb55506cbb6a201931123d495b88623cd3f50d7730 +DIST NVIDIA-Linux-x86_64-525.47.34.run 414249467 BLAKE2B d8454d17df48db3a4403a000e3752031d88dbfb8f827e31ebff96341f2b21c7792996f6b5c60ba36ab777b06cae51491ca1ad92f8217922388e062223699d9c3 SHA512 dd3aab47d920d5bae22565b53c8e9d86db954597095f71aa714774c5028e5f59fa5b86b185fe535e01afc93655700f28bff02218937306251c2aeea464d10eb9 DIST NVIDIA-Linux-x86_64-535.54.03.run 347109768 BLAKE2B 6fce56e4e840b3719b835cc72a749ed807d604ae5cbec63cc42b6ee32fbfa273507029190ed1198ad1f54fd53096dfa0573d043aaa59ffd07cf1607ae6c7943b SHA512 45b72b34272d3df14b56136bb61537d00145d55734b72d58390af4694d96f03b2b49433beb4a5bede4d978442b707b08e05f2f31b2fcfd9453091e7f0b945cff DIST NVIDIA-Linux-x86_64-535.86.05.run 340652483 BLAKE2B ce9aeb902ef6826383d076b828bab31349b72625f9b193ae05a45944e14f5fc87bc086c0caa232d94b215a595bc695b94e1c95c1507d9cf3a060595bf5f65db6 SHA512 92c3052f2fe206012853eef9462a6c58d055098e045e305c34a2e912e5b8542ae839a947c54ffc98d889a0c5cf1cecb6e3ad0e5907370926926cb1b50b53c336 DIST NVIDIA-kernel-module-source-525.125.06.tar.xz 10100204 BLAKE2B 1a7a9f56be4533b8106df25ddf65cd7756cde11fd3e01f96f1f34c7d18af764fcfefc1cf980fed6c0e586e614ccacef9e2cddbabb87c7d7f06a1b27d94f63466 SHA512 1319a2333988795f5b0850cfe769ab0f4c4364bdb516147b85890abb4695aea2553ca0febf9cfcf2f8eafb4c05c3e21f56356ad75e64416c9782b027495028e6 @@ -52,12 +52,12 @@ DIST nvidia-xconfig-470.199.02.tar.bz2 108683 BLAKE2B 80e5b356f1b2a10b2f0d1a139b DIST nvidia-xconfig-525.125.06.tar.bz2 111119 BLAKE2B bd9ef08c361e969775522911a931a25b4512a59d9aa2f90ab1be1696161cd127f20c526b31173d0226408c74da14b5cb381c717d6b8b8b3975b2449e5beb7d9c SHA512 7595f88004aa23595364dd25db35986abb802de80c9e70c9f22367184859057140271dcfd8688ec9d686ca67ae85740c21300ddebd1dbd78af5660896154f3b4 DIST nvidia-xconfig-535.54.03.tar.bz2 110606 BLAKE2B 99af140f7742e23db430fdf392ce985c035c7669f619bff709987a4739e4872ff03991f2324ffbf40f53259906832464f02baf0ba485a16ecdea52af66ab958b SHA512 5927ba6514d25cd0c4a05e42533ea082d5c91c0e05f8cdadedc6fbb5c0b6f0e424d057cee0dfd4dec937514a85f1d28e81c5ea7e2aa8ee374476ba376255d035 DIST nvidia-xconfig-535.86.05.tar.gz 145139 BLAKE2B 2f2af0d0975a483cfbdb922e6d15add620eb1575653a54a1f4916895b2e9450a4f9a7ac2af31ad6286fab76953e567c01f0430b901cb397019673c87a1f35f7b SHA512 384f4a23e356099d7e96da3b79f55de66061d8efd7ec8a016e84c76429ac9769e73927944b3e9e281b858690751406b2964eafd9fe71e74a0bf33e0f67c5e05a -DIST open-gpu-kernel-modules-525.47.31.tar.gz 10323924 BLAKE2B 730aef1ddc296d612934d3782ca9153485d4ec20d4ef0ad0749eda6d5a44288ac512f7c8c2cb2c2ad6791c01d4aa6386f7d7d436a8bc37e20ca3e7b0f7e1d456 SHA512 4de01f30aef7ecd59b3acc5183cc34cabbaa692f3a2c4428ab8d3ffbaf95a040516b075d695daafe2445a0f1cf4362d84558513e5bf750ebd2c30d57000a2414 +DIST open-gpu-kernel-modules-525.47.34.tar.gz 10324093 BLAKE2B 5a3970d5778d3c2ae2af7e675fa98a09d1a6deb5b3498a8cd565a3586704be74d9d192c0e7c90672872e03664b12ca4a233ba2c1959c8949576ea262b5732d27 SHA512 eaaf423c2ebbf00763e449f072b40e9d00d8e483d7c46c9ca46d25eeb00420257ceeb42a40a27cd2470ec77118959394bdf3e88dfd3974e4569dd88dce71854f DIST open-gpu-kernel-modules-535.86.05.tar.gz 12698016 BLAKE2B d0534a2e6b966065f15526c9c699fc4f47cbc12e4bcdba5b5e9d34a920e12aab994009aef158b336ad59ec0cde98bd5686fe606d8bec25ac2aaab49492d37e77 SHA512 da1964921f2f0a07e136ad5301b633c01d1e045b5fbb4ebb32f5d57471a89e649a1b653bbbb62e97755d070ce911c442ceaac2fb3d81baa53af75f4123075308 EBUILD nvidia-drivers-390.157.ebuild 13741 BLAKE2B 536fbe282cb5afa9dc112d3988d695fbc73ed63051cbc638db111f4a9ea59ddb3944155b8b4a2a811440200437a0dc2202bab24e550be32b05d35b4362113638 SHA512 4baacd4bc70c413ea36d81c7114be97e29fca55563131d8bb25b4b645cddd4b4e64c203b7ad587e01cd6e510f83241aae40ddaefe401b86733cd8d02ac4544b4 EBUILD nvidia-drivers-470.199.02.ebuild 14580 BLAKE2B 7e5375290df72ace55c6c343a534b14e9d404cfe3b77cf19fd7048bb6058e844c5cff3565e00a6d2b6832bf2b53d42c9291b8929abf095895501c31706697a1d SHA512 3362dc20826874af6d8c0382244c732c73ee6fae6616c5fb01482d1e394335fdc3d7f6bd49b977ea4fabb350cbb22e1a598ccf1fb28ac3aa6c7717a82965a542 EBUILD nvidia-drivers-525.125.06.ebuild 17066 BLAKE2B 86f556a1409188a1c38f340b2e7202def54c0a4092ee86030e7b410f11de873eba78bbc456eeec0023d7f22250ce1e4e8345e7329224685f40b891e3c69e4184 SHA512 d631dbad857ac68021cceb9bb6351119cccd4c68c599dd983aa8fcc56d19ea6a648713736a9cb68aeef87d5e59d609e9bc49209827c83292a75e864211abfe3e -EBUILD nvidia-drivers-525.47.31.ebuild 17077 BLAKE2B 18675324536ebe1fb32443b2e24d04f3849da3f16fa45604a2a00e311d5549e61c23ab184e8b053f1e5ad068d76547f70a1f62e1389ab3486d33189e5ff6c515 SHA512 16dcb11dc4531a88261e2401818b7421b2b462392043b2d2b9d973faa57674633eba6d3cc8a4fb23aa3f82ebeef0b889d1e1a3e1451afed69776fce58a46743c +EBUILD nvidia-drivers-525.47.34.ebuild 17077 BLAKE2B 18675324536ebe1fb32443b2e24d04f3849da3f16fa45604a2a00e311d5549e61c23ab184e8b053f1e5ad068d76547f70a1f62e1389ab3486d33189e5ff6c515 SHA512 16dcb11dc4531a88261e2401818b7421b2b462392043b2d2b9d973faa57674633eba6d3cc8a4fb23aa3f82ebeef0b889d1e1a3e1451afed69776fce58a46743c EBUILD nvidia-drivers-535.54.03.ebuild 17569 BLAKE2B 55a55905edfb29eb5e05aa5379213fa28525e7f089809c23f32a6b590202f265c45633f4c67c6b224c83ecfd101c5ecab70332889292783d8464eea0aa4dfb3e SHA512 e1864c7103d7cf7705149bacb0cfaf3db527726e0e8c2e6444ee32466893567b77dfcaeb9d859c78b23e433e95ebe43942053e29c3334565f5eb2a8cde7e6a41 EBUILD nvidia-drivers-535.86.05.ebuild 17819 BLAKE2B 0f453c05da293fd9fdf741bfb6f072172a6e100d0442b663e95ec0631c10b28739d6be3e91e91e256b3690b712663ac6bd57c96e1c5a6aa982e31d1114032722 SHA512 1acd2f3e7d14230f6ffa6454bb96deb86edc58b31ab1e9c5dfd31053035246d7f32a3a841d37316f51103ac799ae78fc00367776a8be0bcd5ca43ab89a4ded76 MISC metadata.xml 1281 BLAKE2B 2d2dd88b6c8afbe3b8d4799813fcc65a7102dfaf47fd6266ebd627acce1dde00acdf69d9d85193886cdce3e6553e261987647d12737cdec701ea4f9ba865366b SHA512 00100ef8ec37c1703a2bae7de811ded281c5dcf373407e22e9b359a92feac3ceefb007ed2980ad05cfcc7a698e5434e4cc7e2fc5c6ab82a3d60b679d984963c4 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.31.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.31.ebuild deleted file mode 100644 index 76ec64976572..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.31.ebuild +++ /dev/null @@ -1,500 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MODULES_OPTIONAL_IUSE=+modules -inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1 -inherit systemd toolchain-funcs unpacker user-info - -MODULES_KERNEL_MAX=6.4 -NV_PIN=525.125.06 - -DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://developer.nvidia.com/vulkan-driver" -SRC_URI=" - https://developer.nvidia.com/downloads/vulkan-beta-${PV//.}-linux - -> NVIDIA-Linux-x86_64-${PV}.run - $(printf "https://download.nvidia.com/XFree86/%s/%s-${NV_PIN}.tar.bz2 " \ - nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) - https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${PV}.tar.gz - -> open-gpu-kernel-modules-${PV}.tar.gz" -# nvidia-installer is unused but here for GPL-2's "distribute sources" -S="${WORKDIR}" - -LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" -SLOT="0/vulkan" -KEYWORDS="-* ~amd64" -IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced +static-libs +tools wayland" -REQUIRED_USE="kernel-open? ( modules )" - -COMMON_DEPEND=" - acct-group/video - sys-libs/glibc - X? ( x11-libs/libpciaccess ) - persistenced? ( - acct-user/nvpd - net-libs/libtirpc:= - ) - tools? ( - >=app-accessibility/at-spi2-core-2.46:2 - dev-libs/glib:2 - dev-libs/jansson:= - media-libs/harfbuzz:= - x11-libs/cairo - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXxf86vm - x11-libs/pango - )" -RDEPEND=" - ${COMMON_DEPEND} - X? ( - media-libs/libglvnd[X,abi_x86_32(-)?] - x11-libs/libX11[abi_x86_32(-)?] - x11-libs/libXext[abi_x86_32(-)?] - ) - wayland? ( - gui-libs/egl-gbm - >=gui-libs/egl-wayland-1.1.10 - media-libs/libglvnd - )" -DEPEND=" - ${COMMON_DEPEND} - static-libs? ( - x11-libs/libX11 - x11-libs/libXext - ) - tools? ( - media-libs/libglvnd - sys-apps/dbus - x11-base/xorg-proto - x11-libs/libXrandr - x11-libs/libXv - x11-libs/libvdpau - )" -BDEPEND=" - sys-devel/m4 - virtual/pkgconfig" - -QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" - -PATCHES=( - "${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch - "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-390.144-desktop.patch - "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~SYSVIPC - ~!LOCKDEP - ~!SLUB_DEBUG_ON - ~!X86_KERNEL_IBT - !DEBUG_MUTEXES" - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or - DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." - local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, this should be fine and is supposed - to be fixed but, *if* modules fail to load, then try to either unset - or pass ibt=off to the kernel (ignore this message otherwise)" - - use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 - - use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 - local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of another option that requires it such as CONFIG_KVM." - - linux-mod-r1_pkg_setup -} - -src_prepare() { - # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${NV_PIN},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${NV_PIN},} || die - rm nvidia-settings && mv nvidia-settings{-${NV_PIN},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die - mv open-gpu-kernel-modules-${PV} kernel-module-source || die - - default - - # prevent detection of incomplete kernel DRM support (bug #603818) - sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ - -i kernel{,-module-source/kernel-open}/conftest.sh || die - - # adjust service files - sed 's/__USER__/nvpd/' \ - nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ - > "${T}"/nvidia-persistenced.service || die - use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die - - # enable nvidia-drm.modeset=1 by default with USE=wayland - cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die - use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die - - # makefile attempts to install wayland library even if not built - use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ - nvidia-settings/src/Makefile || die - - # temporary option, nvidia will remove in the future - use !kernel-open || - sed -i '/blacklist/a\ -\ -# Enable using kernel-open with workstation GPUs (experimental)\ -options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP - local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - - local xnvflags=-fPIC #840389 - # lto static libraries tend to cause problems without fat objects - is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - BUILD_GTK2LIB= - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - WAYLAND_AVAILABLE=$(usex wayland 1 0) - XNVCTRL_CFLAGS="${xnvflags}" - ) - - if use modules; then - local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - - local modlistargs=video:kernel - if use kernel-open; then - modlistargs+=-module-source:kernel-module-source/kernel-open - - # environment flags are normally unused for modules, but nvidia - # uses it for building the "blob" and it is a bit fragile - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - fi - - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) - local modargs=( - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - ) - - linux-mod-r1_src_compile - CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig - - if use tools; then - # cflags: avoid noisy logs, only use here and set first to let override - CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - emake "${NV_ARGS[@]}" -C nvidia-settings - elif use static-libs; then - # pretend GTK+3 is available, not actually used (bug #880879) - emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ - -C nvidia-settings/src out/libXNVCtrl.a - fi -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [FIRMWARE]=/lib/firmware/nvidia/${PV} - [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [VULKAN_ICD_JSON]=/usr/share/vulkan - [WINE_LIB]=/usr/${libdir}/nvidia/wine - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglxserver_nvidia") - $(usev !wayland libnvidia-vulkan-producer) - libGLX_indirect # non-glvnd unused fallback - libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source - libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - $(usev !modules gsp) - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json - nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ -$(usev modules " - -Like all out-of-tree kernel modules, it is necessary to rebuild -${PN} after upgrading or rebuilding the Linux kernel -by for example running \`emerge @module-rebuild\`. Alternatively, -if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), -this can be automated by setting USE=dist-kernel globally. - -Loaded kernel modules also must not mismatch with the installed -${PN} version (excluding -r revision), meaning should -ensure \`eselect kernel list\` points to the kernel that will be -booted before building and preferably reboot after upgrading -${PN} (the ebuild will emit a warning if mismatching). - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ -$(use amd64 && usev !abi_x86_32 " - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.") - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - if use modules; then - linux-mod-r1_src_install - - insinto /etc/modprobe.d - doins "${T}"/nvidia.conf - - # used for gpu verification with binpkgs (not kept, see pkg_preinst) - insinto /usr/share/nvidia - doins supported-gpus/supported-gpus.json - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - if use tools; then - emake "${NV_ARGS[@]}" -C nvidia-settings install - - doicon nvidia-settings/doc/nvidia-settings.png - domenu nvidia-settings/doc/nvidia-settings.desktop - - exeinto /etc/X11/xinit/xinitrc.d - newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings - fi - - if use static-libs; then - dolib.a nvidia-settings/src/out/libXNVCtrl.a - - insinto /usr/include/NVCtrl - doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert - continue - ;; - GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/opt/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && - dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - : "$(systemd_get_sleepdir)" - exeinto "${_#"${EPREFIX}"}" - doexe systemd/system-sleep/nvidia - dobin systemd/nvidia-sleep.sh - systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service - - dobin nvidia-bug-report.sh - - # MODULE:powerd extras - if use amd64; then - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # don't attempt to strip firmware files (silences errors) - dostrip -x ${paths[FIRMWARE]} - - # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292) - # are widespread and sometime affect revdeps of packages built with - # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, - # ebuilds should handle manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' -} - -pkg_preinst() { - has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= - - use modules || return - - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die - - # try to find driver mismatches using temporary supported-gpus.json - for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do - g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ - "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) - if [[ ${g} ]]; then - g=$((${g##*\"}+1)) - if ver_test -ge ${g}; then - NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" - break - fi - fi - done - rm "${ED}"/usr/share/nvidia/supported-gpus.json || die -} - -pkg_postinst() { - linux-mod-r1_pkg_postinst - - readme.gentoo_print_elog - - if [[ -r /proc/driver/nvidia/version && - $( ${EROOT}/etc/portage/package.mask/${PN}" - else - ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" - fi - ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" - ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "[1] https://www.nvidia.com/object/IO_32667.html" - ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" - fi - - if use kernel-open; then - ewarn - ewarn "Open source variant of ${PN} was selected, be warned it is experimental" - ewarn "and only usable with Turing / Ampere and later GPUs, aka GTX 1650+." - ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" - ewarn - ewarn "Many features are not yet implemented in the drivers and limitations are" - ewarn "to be expected. Please do not report non-build/packaging bugs to Gentoo." - ewarn "Switch back to USE=-kernel-open to restore functionality if needed for now." - fi - - if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then - elog - elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" - elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" - elog "experimental but is required for wayland." - elog - elog "If you experience issues, either disable wayland or edit nvidia.conf." - elog "Of note, may possibly cause issues with SLI and Reverse PRIME." - fi -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.34.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.34.ebuild new file mode 100644 index 000000000000..76ec64976572 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.34.ebuild @@ -0,0 +1,500 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.4 +NV_PIN=525.125.06 + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://developer.nvidia.com/vulkan-driver" +SRC_URI=" + https://developer.nvidia.com/downloads/vulkan-beta-${PV//.}-linux + -> NVIDIA-Linux-x86_64-${PV}.run + $(printf "https://download.nvidia.com/XFree86/%s/%s-${NV_PIN}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${PV}.tar.gz + -> open-gpu-kernel-modules-${PV}.tar.gz" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S="${WORKDIR}" + +LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/vulkan" +KEYWORDS="-* ~amd64" +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + sys-libs/glibc + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + )" +RDEPEND=" + ${COMMON_DEPEND} + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + wayland? ( + gui-libs/egl-gbm + >=gui-libs/egl-wayland-1.1.10 + media-libs/libglvnd + )" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + )" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch + "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-390.144-desktop.patch + "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!SLUB_DEBUG_ON + ~!X86_KERNEL_IBT + !DEBUG_MUTEXES" + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set, this should be fine and is supposed + to be fixed but, *if* modules fail to load, then try to either unset + or pass ibt=off to the kernel (ignore this message otherwise)" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${NV_PIN},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${NV_PIN},} || die + rm nvidia-settings && mv nvidia-settings{-${NV_PIN},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die + mv open-gpu-kernel-modules-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die + + # temporary option, nvidia will remove in the future + use !kernel-open || + sed -i '/blacklist/a\ +\ +# Enable using kernel-open with workstation GPUs (experimental)\ +options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + ) + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # cflags: avoid noisy logs, only use here and set first to let override + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [VULKAN_ICD_JSON]=/usr/share/vulkan + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + $(usev !wayland libnvidia-vulkan-producer) + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use amd64; then + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $( ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open; then + ewarn + ewarn "Open source variant of ${PN} was selected, be warned it is experimental" + ewarn "and only usable with Turing / Ampere and later GPUs, aka GTX 1650+." + ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + ewarn + ewarn "Many features are not yet implemented in the drivers and limitations are" + ewarn "to be expected. Please do not report non-build/packaging bugs to Gentoo." + ewarn "Switch back to USE=-kernel-open to restore functionality if needed for now." + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi +} -- cgit v1.2.3