From 639971d0c3ee4eef36854ab7d9729b6e8c3ac1cb Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 7 Nov 2023 04:19:48 +0000 Subject: gentoo auto-resync : 07:11:2023 - 04:19:48 --- x11-drivers/nvidia-drivers/Manifest | 6 +- .../nvidia-drivers/nvidia-drivers-535.43.15.ebuild | 515 --------------------- .../nvidia-drivers/nvidia-drivers-535.43.16.ebuild | 515 +++++++++++++++++++++ 3 files changed, 518 insertions(+), 518 deletions(-) delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-535.43.15.ebuild create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-535.43.16.ebuild (limited to 'x11-drivers/nvidia-drivers') diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index 9fa9c565e788..95d00c295dec 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -29,7 +29,7 @@ DIST NVIDIA-Linux-x86_64-525.125.06.run 414318862 BLAKE2B 204c53bbf579edf6d88c9a DIST NVIDIA-Linux-x86_64-525.147.05.run 414135234 BLAKE2B 77a12905771772804a5e5cf36df3e5032fe0160ac7c8a1b4ea002f65dac3732d9c900c1787a3e26d08b951a8de4893467cc7a80d424e017990d12669354d4191 SHA512 0c7b31715fce6a7bd77a2d9f9a3dca54a929a7790d748051576f62cdaeaeb6a9d0f3fbb13f0b20a51966bdb9470acdbc9ee529a9e84f38a9c834a1bd28d81773 DIST NVIDIA-Linux-x86_64-535.113.01.run 341515532 BLAKE2B 2fe0564771f14618010bd1d8932db1d6c98701faabfd8a867f5f0e9939dcff6d64744c3f2272b62701c231473e49dd1b22687db777a1950c4e0f40f091b70ed2 SHA512 bf939843404bc163246b710ca336236f28af489f77ee1830a2d20d4ca926a434b6fbc2156d5777dc004692d5d1adbef77ce79071247f81da2db9adf42c32bfa7 DIST NVIDIA-Linux-x86_64-535.129.03.run 341660534 BLAKE2B 46c79bad145524098b246e70294a9f9a513a8f0890b7ea57d9fb9dc761ae858bb69b9dd9308075ce80081e4dd28fb9ce9b336a2bf6280393b7d4c903f808d38c SHA512 3d7142658fe836e1debf7786857bdb293490ef33351e9b7d39face245fe8596b0f46052b86fae08350fcda1e2a9fd68d7309b94e107d1b016bd529d8fc37e31f -DIST NVIDIA-Linux-x86_64-535.43.15.run 341023520 BLAKE2B 50964ffbb9a8dc5518b0302e5bf0e63ee18b2e9cd8fb3536fc4bd2a7aee0568b8211ea018b86cec4a092c56eb15bc40c36de687d3a72a711ca865048eb827cf2 SHA512 3853be4ae890d1e8e9c21f6a6aac9402eaf3a46b0b775baad944e18a3d02be3d392c2fcc1414d04749310fdbab629c5edecb709fbab19081dd9993122670371d +DIST NVIDIA-Linux-x86_64-535.43.16.run 341174010 BLAKE2B 0c4c91c78ff8ca49ae0c1d22ad90ef49e658ddd71d822e5345b562bbc55cadf5593cde8b7a5ecf999fa522cf668144df6afaad1bc46fbbc637c865d4333451b3 SHA512 ded8e1f3f135b73e6f56d5b50d4cc883dd6c0e7d087ef705ae005ee54e4ebdc33939e16eaff6b29c22dc3c76c99d0ec3772be6d12269d985b911ba6c46d5b436 DIST NVIDIA-Linux-x86_64-545.29.02.run 324785376 BLAKE2B b9cdad9d4e2d221c39b845033929ff5a02784cd97f9204315204707fdf48f65761bca9fb69449ecd0ef3e608f2bebb8d7df4ed7f993efc110257aaf0b8e019f7 SHA512 b3d31d19f2912e4926446b609c07f181fae00b1dc4b025ddb52f8c28a1f14904d29ff6514fd04c734776bec82a351476009d60be9293968fbea7dc62ed580de8 DIST NVIDIA-kernel-module-source-525.125.06.tar.xz 10100204 BLAKE2B 1a7a9f56be4533b8106df25ddf65cd7756cde11fd3e01f96f1f34c7d18af764fcfefc1cf980fed6c0e586e614ccacef9e2cddbabb87c7d7f06a1b27d94f63466 SHA512 1319a2333988795f5b0850cfe769ab0f4c4364bdb516147b85890abb4695aea2553ca0febf9cfcf2f8eafb4c05c3e21f56356ad75e64416c9782b027495028e6 DIST NVIDIA-kernel-module-source-525.147.05.tar.xz 10140684 BLAKE2B a8ce7c1d1047be9154fd67366c5bfa13a19f03c883f24ee35043d17d517e83303420449750f9e7adc7142f61564dd5d8e5a19884dbe540514979df6381ff7f1f SHA512 58920b26081a68e05178176edb0ce8ac4a5d365492adf51d6ffe57102385ff08abc5e14741e0500419e62a752441c97051d60939245eea64b039cc7efca15b7d @@ -76,7 +76,7 @@ DIST nvidia-xconfig-525.147.05.tar.bz2 110987 BLAKE2B 49116c8922b5c14eaa88b6230a DIST nvidia-xconfig-535.113.01.tar.bz2 110630 BLAKE2B ca6d9f5c5b2d841049322af19dcf3ed668a1140d3dc6be80a4e32a0c480dfda6c86ce09f60b6bf1eeb67b5fdf86c5776b544d2e5e9d2497c06db6e9280f0ac41 SHA512 1f238525cdb9bf6f2e27b703cec144ff03400e2fa7ca79cb425b455aa9b8c21de9473dcfe7b212aefff5f69eba0537f76560b0be7953bbf6ec0c7bb47bf984fe DIST nvidia-xconfig-535.129.03.tar.bz2 110605 BLAKE2B 45bfeb73a89bb4e74f52ce713bf9bdb099ec5e8421e27f5d4750906e18ddc7787a972e6d21ddc12e5bdab41f60f5524932183997739c3255bb4b61c1c32b9ec8 SHA512 c26a3b5698150c617ac3c6a088b6934044e201702f295f71ce66434d4d2d2ea93682eb580d772837a433947704591e979e1c45e7d2f3fb0b7224a22a849583b2 DIST nvidia-xconfig-545.29.02.tar.bz2 110982 BLAKE2B bdab0370fda3ea2a0dcf8e50be56a15965a90fce9544e14b9528cedd20e0c232160f6a156d1c850359f23fb31776ba789c30d253f2c54e2c991444d7608de19f SHA512 ac51e6e674cff313841b0de29960ecd098f401bc866185dc61e5dc898b2e4ea521e684803223f7f6455c7493e9fc7e37f1ddb7d27455e6643414463cfa01c32d -DIST open-gpu-kernel-modules-535.43.15.tar.gz 12754224 BLAKE2B 1b1854c4976ba999bfe2f186456f3d3640883bb408e80ff843fe74492dd5692f24abca765e519e84139218f877d46b40b4ff641b78574157ae9b0fc63bd7f5ac SHA512 ab9fa1d15b0545058bdb102e356b3f5a4eea97a74fa38adb6c8ed537e405d73fba636086d47fc8e312e8a2d9c95169c7699e482d2db85fa075d8d93b858af77e +DIST open-gpu-kernel-modules-535.43.16.tar.gz 12752490 BLAKE2B e74916c7a232838b3680c9595e52520465bf889001b5f503ac98b5a591d8f05bf08ae4445a4cadd704ab719b0bfc2716f54d3a27bd11a90ece6093ac05591320 SHA512 7da67b3c3fe3618bb2c6e503224fbaf87d6c2bf21e5f1766eb443cf22c3d40fb8f1be1753c3d4cdbc187e7a80c5ecd5fe7a0fe1209168d662eed16a27369fd3b EBUILD nvidia-drivers-390.157.ebuild 14114 BLAKE2B 7b4f016ba4e5fb28f2c90d6566c72425d70e3bf49d13a1795f39084c9fb056002e61b5d88ca2876575a7cb29bb106cb1510e5aaeff60a0daf351e089d3531dcc SHA512 e0e3ca291447a36f17681ffa8b7f2fa7f4870a45bc2dbf33740443fa4fcab37fed26c6bf7fa81492b609ed867f832a5712d699d1da3945e1350c605955dc4de1 EBUILD nvidia-drivers-470.199.02.ebuild 14770 BLAKE2B 1f31dd576470421c76083dfca8f46896319c0bdd9b1585e855440931af80f9449527ebb9de7b129b8e476aa44eb200bc9351dc169cfba6dbcede570ec83bccf9 SHA512 229b06ff97b94e56e527c070cc6be0500ff12c58f7ebfe417e88a6b3fa71c526e5955de2140c0c143b23704235a092801b6dacab81319f540196d35a85be158f EBUILD nvidia-drivers-470.223.02.ebuild 14771 BLAKE2B 1132cbd7a91230bc547a59f3a3c284d20cdda789252ad9897b7b442ab00f3cd26f7c55f5254cd8d93e68a2b33b3f949dd2fce3a03943c304caa20f81233b3a48 SHA512 553143447173926206549dd0b778a3c4cb8df1da9b8cb96745d44529b4a46935d0a7a69fc3c19f9ddeea4c5a7e8af0b3b11aeacd21756ad643d6f6b199193f64 @@ -84,6 +84,6 @@ EBUILD nvidia-drivers-525.125.06.ebuild 17059 BLAKE2B 1b4ce78dbe1851475f0b349913 EBUILD nvidia-drivers-525.147.05.ebuild 17060 BLAKE2B 87f43a8706e2395a6799ea9b90a43b9fb046a45bbff9602aff5b161f683b5e85c8e9ecaad7dfb21a710645f683043c6399904685c76d7a103a7b56370d115aae SHA512 d46690b421e4d98a5466614d47c748801324cdb061caa02448aca45ee9fb1086ec5894bc6c1d3f10e6bec195fafefeca5b3dbcc96cd32a32dc705cae59b49985 EBUILD nvidia-drivers-535.113.01.ebuild 17180 BLAKE2B c8681b8af4fc21ace63a43de1672d3f8b6af4c1ef38db1a346296e4f0ebd58341fd7986333dabd60b024d5414e2af64a396b2d88f2b753ba8fbcfbe68f665c4e SHA512 c540bcd3ad38a3db10029fce735f61371a6cbd3b65e8b58eb58ca8ab6fea74a745a798c0b09ef5da7c6e9d0547630abc9f3b41bd8bfadc558bc0deeefe55415a EBUILD nvidia-drivers-535.129.03.ebuild 17181 BLAKE2B 20346e8146801fffe261d9f225f7dbbab113e9e3b2d9317d99a01f2dd0fedf8ad82b0ec86c42e9738bfa7d65a924db8974b0b09ce398607af1c7429d57237e52 SHA512 f6d363df3aeed0e589a0b75553c16f7c9272163cf09a5fe1e7259aaeb6e31d7410d9330f8bd446699e0ce846e8ce5039e413ea2b81ba2e6d025d37cb3e681a06 -EBUILD nvidia-drivers-535.43.15.ebuild 17229 BLAKE2B c9ff5611b931ad49433cc7c168a1c20c7fedfe93080be8ccce1ee7aab099432b46d4ba8a7cdb9d30804a49372e2f2caec7bc37695c3678fa202a3f1cecae03c8 SHA512 215905f618ca3e13df3bc24605453e44fcbecb2eb03701eac03fb62b8a5e9c60281c21b200aa1f87143fece691ee11fc912966a1ec6596816dfd6de329e2c207 +EBUILD nvidia-drivers-535.43.16.ebuild 17229 BLAKE2B fca41a844a58c082d10aa61eb408dae133e95ee95e92921b7112b16938aa3a7c5241e7544da721de15a780288e96941067ac12089205a1541536982fb200c4d6 SHA512 6d17aa2838c732740c50a87f2064687ba02b7a2cd71d189c1766b4d2213acb3cb928fedd7d1b18c5b866ed62dcd399db1a43515790530d976f47c84c0d4672bb EBUILD nvidia-drivers-545.29.02.ebuild 16756 BLAKE2B 64ec029d2b9b80f6434485a4e2c8b7de5c51af5084bd5ad316797b971e8d619e516961cd97bb8c6cd28f366e9c268584affff13b96cb3a50937ec2f2da38a70c SHA512 30f73fb2244c6fb2b422a29de811087402d4b1d392488192895ba910400da132d531035235e3b58101f47ef349de29361bb83090e9e79f5d081ba5c88ba75be4 MISC metadata.xml 1276 BLAKE2B 9fd18d8984ae4440f9623426edea81096b3aef9e591737d45f434848a24d50bda3ea6fa14fa412a9a59404b6256f00147b1a4650cf5f7a1a1445363fd844b522 SHA512 e46e21f95ea3b84dae5dee6bd2fa61efa4df7ebbf9ecb8033d5d590ad05c1343119822a50a156c3a46fcec5fbd1977cb6d6fc74c32e64ac4e8ded9760f09d91c diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.15.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.15.ebuild deleted file mode 100644 index 376def9afc54..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.15.ebuild +++ /dev/null @@ -1,515 +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.6 -NV_PIN=535.113.01 - -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 Apache-2.0 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 - dev-libs/openssl:0/3 - 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} - dev-libs/openssl:0/3 - sys-libs/glibc - 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-kernel-module-source-515.86.01-raw-ldflags.patch - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch - "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~SYSVIPC - ~!LOCKDEP - ~!SLUB_DEBUG_ON - !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 and, if the CPU supports the feature, - this *could* lead to modules load failure with ENDBR errors, or to - broken CUDA/NVENC. Please ignore if not having issues, but otherwise - try to unset or pass ibt=off to the kernel's command line." #911142 - use kernel-open || CONFIG_CHECK+=" ~!X86_KERNEL_IBT" - - 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-flags -fno-plt #912949 - 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}" - ) - - # temporary workaround for bug #914468 - CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_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 - # avoid noisy *very* noisy logs with deprecation warnings - 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 - [OPENGL_DATA]=/usr/share/nvidia - [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 - libnvidia-pkcs11.so # using the openssl3 version instead - ) - 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]} == EXPLICIT_PATH ]]; then - into=${m[3]} - 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 for modern GPUs (e.g. GTX 1650+). Try to disable if run into issues." - ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" - 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-535.43.16.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.16.ebuild new file mode 100644 index 000000000000..26fe47dbf11b --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.16.ebuild @@ -0,0 +1,515 @@ +# 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.6 +NV_PIN=535.129.03 + +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 Apache-2.0 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 + dev-libs/openssl:0/3 + 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} + dev-libs/openssl:0/3 + sys-libs/glibc + 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-kernel-module-source-515.86.01-raw-ldflags.patch + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!SLUB_DEBUG_ON + !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 and, if the CPU supports the feature, + this *could* lead to modules load failure with ENDBR errors, or to + broken CUDA/NVENC. Please ignore if not having issues, but otherwise + try to unset or pass ibt=off to the kernel's command line." #911142 + use kernel-open || CONFIG_CHECK+=" ~!X86_KERNEL_IBT" + + 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-flags -fno-plt #912949 + 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}" + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_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 + # avoid noisy *very* noisy logs with deprecation warnings + 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 + [OPENGL_DATA]=/usr/share/nvidia + [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 + libnvidia-pkcs11.so # using the openssl3 version instead + ) + 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]} == EXPLICIT_PATH ]]; then + into=${m[3]} + 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 for modern GPUs (e.g. GTX 1650+). Try to disable if run into issues." + ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + 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