From bb5caf02fffada276b5aa598b3b6faea88ca0784 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 16 Jun 2023 07:40:50 +0100 Subject: gentoo auto-resync : 16:06:2023 - 07:40:49 --- x11-drivers/nvidia-drivers/Manifest | 6 +- .../nvidia-drivers-525.47.26-r2.ebuild | 561 --------------------- .../nvidia-drivers/nvidia-drivers-525.47.27.ebuild | 561 +++++++++++++++++++++ 3 files changed, 564 insertions(+), 564 deletions(-) delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-525.47.26-r2.ebuild create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild (limited to 'x11-drivers/nvidia-drivers') diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index afc11dcc3b0a..00e8cc8d4331 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -24,7 +24,7 @@ DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb9049 DIST NVIDIA-Linux-x86_64-470.182.03.run 271685302 BLAKE2B 47acdc53dea1698558fea8e18f481341dd542b725153a83563f9da420844b59db41f69a8eb7ad7e16a22050a7a6cffc2265a9cb8832cb5a6439c6a5b0910bfce SHA512 73619d65bd3267427acaf2deee07a2c98c490df937aa13e2c95d54cfd19ce2a82a91d3a5aa886dbe88f6230251f9cf54c38f5841cfacd77e53301e8d61fa3d7d DIST NVIDIA-Linux-x86_64-515.105.01.run 363738348 BLAKE2B b78b7e9dbc1450a7d01d9b3b75e0612ce0b71f8647dc5ee084660c9cb12a8ac4b2f278d49b195e0f4600d02f3297af796158cbca9cdaff0d27f78f56153bdefd SHA512 9b9e820754254c70aeab2bcc1cfdae396d3b30fb948198e378f764a6f0d89ad6f6687afffa2d6f48072ab726c6d180dc3c83891eef61f273c0b11f7bc2c9bd67 DIST NVIDIA-Linux-x86_64-525.116.04.run 413341618 BLAKE2B f769c72bb38c10e16f88bdf655ef77a480097c31b5856de00858494e1b1708bc243d8d562e37b15c7fc4641c7c4937472cf16f84fc1b3b3dc837ace35a3570de SHA512 8e511e4965f11c849ae0bb3f399bc79eb004bb3a15612b35e6c7b9ec236a73085b58cc4e8cb37b5ffde7e7fe202928a08618b5dd3328235795bb942bde339195 -DIST NVIDIA-Linux-x86_64-525.47.26.run 414811422 BLAKE2B 9dbb4ed5ce71b329f2c2fd12ae5697f299212916f9a0c357e4526863abd3d6123b9f6769dd44c0c1adbf43ca1f6f5e596ac6ec34cf06802428b652fa1ff494dd SHA512 41d77f7200acff1cc8c3dd86e4809555ca5a0c84f405c864431a6b195826ee4263830eee182525d19ef96b8714dfec04a6416189c9ad9959e6e58147820ae94b +DIST NVIDIA-Linux-x86_64-525.47.27.run 414752583 BLAKE2B e38c1e9015ea240e32f8c1e3c9e47124574c060e90172352ca1db28b1e548babae216f2e8c6391fdf2708304e49321b3dae86fee0d3a353cc576291583813791 SHA512 170291b58e37db1e1598b4703d86ffcd6a756a9b338f0394a77d790aea6c38d85d2806960d4fc8d125c1c6c7fb43d69500c3efe2f85cb0d00397935b8cd0af58 DIST NVIDIA-Linux-x86_64-530.41.03.run 344312858 BLAKE2B bb5507afd23e6e063314532f37e5c7cc2530f96f359664d79ebac998c6a32ee238790b4aa66339a913e31114d22795e8e80aebced2260ff04b5d3589af472fc9 SHA512 90068122824322884ec8f3e4be2fe7f76bf07ee1163baf6da15d09ba3ff886e5c5ef72016509eef9f4af9d85f154ebbe051d5fb3af5e867f1f67f03af8068100 DIST NVIDIA-Linux-x86_64-535.43.02.run 347044349 BLAKE2B 0b5c924546c7aea92051fd6a3daef26afe0d9efc141a6653c83d286738fd7c4287230a5d84fd7fc402251a7b73f461334f39e241d16daad46c03c17921dcff7e SHA512 6e477444997b88b127d2a18d1aa3bd0326a432c327f2ea3be5b50bb1813dc5dfb9099d02910989097a59a760b87710c24f27e5310df3b6da4894f212d37ff5b2 DIST NVIDIA-Linux-x86_64-535.54.03.run 347109768 BLAKE2B 6fce56e4e840b3719b835cc72a749ed807d604ae5cbec63cc42b6ee32fbfa273507029190ed1198ad1f54fd53096dfa0573d043aaa59ffd07cf1607ae6c7943b SHA512 45b72b34272d3df14b56136bb61537d00145d55734b72d58390af4694d96f03b2b49433beb4a5bede4d978442b707b08e05f2f31b2fcfd9453091e7f0b945cff @@ -68,12 +68,12 @@ DIST nvidia-xconfig-525.116.04.tar.bz2 110583 BLAKE2B 7fa42ffddee83dd6df0f3d8625 DIST nvidia-xconfig-530.41.03.tar.bz2 110920 BLAKE2B c7b90382b0e42f9f0d839c40c53c613243314399c715c303d9221c1d9558bed4d159bc1b76c2ab8ff4831d32fc93b661650b9833ef7397559847c3a14763cdfa SHA512 72cb1b44ff2fd162fc76fa4993b24a2994545b2b5e8f23252729a55e2deb2d10cc9263dfbe6449a81e3e18beca0bd6506b295a7299696bb9fea628fd99dca555 DIST nvidia-xconfig-535.43.02.tar.bz2 110594 BLAKE2B 2a72f408b3fe4acc21d5c1c9f266db6c0e79aefd25acad8237936bcbd204eefa73182cc950ab3c491efee712540a7a9480a06f4941d407ee7db1db03984f3e16 SHA512 e2078cf80c0bce8f3718917da4da5a1ac534e51b19b49780bdb6d7dcc0a8fe08d38177602b2f3a35fab64ecef65f04ed0a62fcbdd224c305fde493333f6a5cb9 DIST nvidia-xconfig-535.54.03.tar.bz2 110606 BLAKE2B 99af140f7742e23db430fdf392ce985c035c7669f619bff709987a4739e4872ff03991f2324ffbf40f53259906832464f02baf0ba485a16ecdea52af66ab958b SHA512 5927ba6514d25cd0c4a05e42533ea082d5c91c0e05f8cdadedc6fbb5c0b6f0e424d057cee0dfd4dec937514a85f1d28e81c5ea7e2aa8ee374476ba376255d035 -DIST open-gpu-kernel-modules-525.47.26.tar.gz 10323511 BLAKE2B 00d9dd7bef6cf8ce3aaa53bd8c5b756c40ad44bfc21d72118006e4ff1a91ec49e7cf784ad53a8e55b757c451c875d500527b15a904ddf590bca0cf357baf7737 SHA512 ac2ee2e8d32c8a37b000769742f4e242c40daba87e9fc5829e16acbba095e7cfcd05cae4127de6095a058c1b7c9b95ea64c012ef561cf165259db2cbc8b4c736 +DIST open-gpu-kernel-modules-525.47.27.tar.gz 10324085 BLAKE2B b9f7297ada26dc8db9652ddc37144b69f28d473e9c7638acce0b6abb26ab6dc5f3fe31a5b666f8b99857c9d4d5443e46fba5140d4969a244697a26f0da49a34d SHA512 bd1a434aaea27ff1db33dbbd30b32247a870e2079d925d272b09a41d09f50ed192a3246a57dd5c78649ad77a898710701981effa55f574495f7c504e2fb9b8e8 EBUILD nvidia-drivers-390.157.ebuild 16169 BLAKE2B f71d710e1cbd5451d080aeed1cdb9a6d4808ea116380f6aec8a7607b9459f4b5470e9cf1f689dd6980ab15d113b2ef873bd4b0b78eebec2646037a524fe5a48e SHA512 2d695d0f7def7b4e21dad10f4d51eb8419a69a52ad1d2ca00d99f86dcc84d5dd181f392bf6e962c00d51c79e4c9c091796d5976a76cb1d0c9f29f2034d10f0c9 EBUILD nvidia-drivers-470.182.03-r2.ebuild 16977 BLAKE2B a402c71f5d0b14ed598bc3aabf41b7d672b946bb4db9e0b93574690267865a0a30e79d3e6e8b51152d019aadea2f4e7c5a7ae754d69a1ec67095c8eeabe466e0 SHA512 8ade003e22476749cd29ff415d9251e528d5fbee759420bfc4c5fed9e3101ae56110865dc6deb2098e19baa16d0ec3bc1a07d12a5f7b68d6788abc8bf122d2a3 EBUILD nvidia-drivers-515.105.01-r2.ebuild 19515 BLAKE2B d038ca4f2e2e9fdbd04baba5018c880622c41660f3d18ffa9a80a454ce21f36bd9820fc6b5301b3815cd9588295ba46330554e4dbe756ad22e54f3ccdb5f921c SHA512 eaf4ae959fb2d76a1344ba770cf4dae25c19e26edafc0de18d89f264aaa4578de3cf35ed67d3e1a23b79e43816a6a8a6cf7813e00834b4c245f5c13c9a94f5f5 EBUILD nvidia-drivers-525.116.04-r2.ebuild 19393 BLAKE2B 7e795c11da76734e0c25f7d74f4d973895b982bb5f871824f5cdeab1391ae60bb06dbe590cfa6c3adb70f7548c2ac165f71a91264eb26765a0c9d0b5bfaff83c SHA512 ce019606f2207cec235d30b4513703393b38faa7cbcbd8ae252bdbf93f4fb7d78d9cb3ae4ccadc6a3f53cf2ff7b6be23ad78b32eabc88b8bcaf30a6bf63c2cc2 -EBUILD nvidia-drivers-525.47.26-r2.ebuild 19404 BLAKE2B 23da78945222610361a5db9bbcf3ed4b2715c6533b84ef7e47d196259b140066cb28e88520908783c1ed477216577b656e70d50c739e6d342106cc25e257cdbd SHA512 6f6993243747cea2cd3dcd9be8a4a3762be9d5a3f9cfac91db0d391c265e12b52b9b121106285440e2f79d1bb9877b627ce1d1e4a02f2073cefe852fd16fdf41 +EBUILD nvidia-drivers-525.47.27.ebuild 19404 BLAKE2B 23da78945222610361a5db9bbcf3ed4b2715c6533b84ef7e47d196259b140066cb28e88520908783c1ed477216577b656e70d50c739e6d342106cc25e257cdbd SHA512 6f6993243747cea2cd3dcd9be8a4a3762be9d5a3f9cfac91db0d391c265e12b52b9b121106285440e2f79d1bb9877b627ce1d1e4a02f2073cefe852fd16fdf41 EBUILD nvidia-drivers-530.41.03-r2.ebuild 19396 BLAKE2B e818d02b27385df413f38211451c36b52acb202449448700f5b704b85705d19f11530b051e4c09ccb29c2477bcbc43a203a154e893758f2d517661f0a3e86202 SHA512 9304a64b3a2b3cf87ae70c1ebf9b0d346ee1daa98302c89bb20528455a7dd38a8f7f7dd6aaff67a6bbb78d049b92f77a05be992b8aaa1f1a24c2bfe6731abfb1 EBUILD nvidia-drivers-535.43.02-r2.ebuild 19946 BLAKE2B 9637d3e210deb50d7dc78361072aa7b9d81b5b5f8315c7b3198fe955b8fa9533e77badd0734a17160793acd4f0eef6e5763a18e0440b9d19fe007678868d93fb SHA512 f88f86836859615e75a29b36b7ccaad4a3124ddf73ed55f2b6d19e78f7e52c6ae87c037bf15813bd8816c314df7165e13da59447ba1cb8cc30d3f3cf61473503 EBUILD nvidia-drivers-535.54.03.ebuild 19963 BLAKE2B 7c02ad201c8136350618e146ec565aaa913544c9ca3227fef857ed3d6d67ba527e4ea1c9ecc3314794bb8ac81d1e275597d9c64ba9a1e0cbf6b90e5994308ef1 SHA512 c1046ed0e6766ca2a9d20b7f1891e9980a6b117597ee56c1ec12c5146a2213e2a68fe74eaa0e90db7689ec4caa5ecbd4d2990dd1c6c65b765019b9c3767236ce diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.26-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.26-r2.ebuild deleted file mode 100644 index 6b8d1b4212dc..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.26-r2.ebuild +++ /dev/null @@ -1,561 +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.3 -NV_PIN=525.116.04 - -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-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 - - # do some extra checks manually as it gets messy to handle builtin-only - # and some other conditional checks through CONFIG_CHECK - # TODO?: maybe move other custom checks here for uniformity - local warn=() - - if linux_chkconfig_builtin DRM_NOUVEAU; then - # suggest =m given keeps KMS_HELPER enabled and can serve as fallback - warn+=( - " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" - " modules (can be safely kept as a module (=m) instead)." - ) - fi - - if linux_chkconfig_builtin DRM_SIMPLEDRM; then - # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its - # configs (bug #840439), but without Fedora's kernel patch to - # workaround this issue (which is unlikely to work for us anyway) - # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 - warn+=( - " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" - " (i.e. blanks when X/wayland starts, and tty loses display)." - " For prebuilt kernels, unfortunately no known good workarounds." - ) - fi - - if ! linux_chkconfig_present FB_EFI && - ! linux_chkconfig_present FB_SIMPLE && - ! linux_chkconfig_present FB_VESA - then - # nvidia-drivers does not handle the tty (beside mode restoration) but, - # given few options are viable, try to warn if all missing - warn+=( - " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally" - " needed to get a display for the tty console. In most cases, it is" - " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." - " Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs" - " or not using the tty may be able to safely ignore this warning." - ) - fi - - if kernel_is -ge 5 18 13; then - if linux_chkconfig_present FB_SIMPLE; then - warn+=( - " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI or" - " FB_VESA as it currently may be broken with >=kernel-5.18.13 + NVIDIA:" - " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" - " (feel free to ignore this if it works for you)" - ) - fi - - if linux_chkconfig_present SYSFB_SIMPLEFB && - { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } - then - warn+=( - " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" - " from providing a working tty console display (ignore if unused)." - ) - fi - fi - - (( ${#warn[@]} )) && - ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" -} - -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 - - # 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=( - # nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia - $(usev !X " - libGLX_nvidia libglxserver_nvidia - nvidia_icd.json nvidia_layers.json") - $(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 general information on using ${PN}, please see: -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" - 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.27.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild new file mode 100644 index 000000000000..6b8d1b4212dc --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.47.27.ebuild @@ -0,0 +1,561 @@ +# 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.3 +NV_PIN=525.116.04 + +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-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 + + # do some extra checks manually as it gets messy to handle builtin-only + # and some other conditional checks through CONFIG_CHECK + # TODO?: maybe move other custom checks here for uniformity + local warn=() + + if linux_chkconfig_builtin DRM_NOUVEAU; then + # suggest =m given keeps KMS_HELPER enabled and can serve as fallback + warn+=( + " CONFIG_DRM_NOUVEAU: is builtin (=y), and will prevent loading NVIDIA" + " modules (can be safely kept as a module (=m) instead)." + ) + fi + + if linux_chkconfig_builtin DRM_SIMPLEDRM; then + # wrt prebuilts, Fedora is pushing =y and gentoo-kernel-bin uses its + # configs (bug #840439), but without Fedora's kernel patch to + # workaround this issue (which is unlikely to work for us anyway) + # https://github.com/NVIDIA/open-gpu-kernel-modules/issues/228 + warn+=( + " CONFIG_DRM_SIMPLEDRM: is builtin (=y), and may conflict with NVIDIA" + " (i.e. blanks when X/wayland starts, and tty loses display)." + " For prebuilt kernels, unfortunately no known good workarounds." + ) + fi + + if ! linux_chkconfig_present FB_EFI && + ! linux_chkconfig_present FB_SIMPLE && + ! linux_chkconfig_present FB_VESA + then + # nvidia-drivers does not handle the tty (beside mode restoration) but, + # given few options are viable, try to warn if all missing + warn+=( + " CONFIG_FB_(EFI|SIMPLE|VESA): none set, but note at least one is normally" + " needed to get a display for the tty console. In most cases, it is" + " recommended to enable FB_EFI=y and disable FB_SIMPLE (can be quirky)." + " Non-EFI systems are likely to want FB_VESA=y. Users with multiple GPUs" + " or not using the tty may be able to safely ignore this warning." + ) + fi + + if kernel_is -ge 5 18 13; then + if linux_chkconfig_present FB_SIMPLE; then + warn+=( + " CONFIG_FB_SIMPLE: is set, recommended to disable and switch to FB_EFI or" + " FB_VESA as it currently may be broken with >=kernel-5.18.13 + NVIDIA:" + " https://github.com/NVIDIA/open-gpu-kernel-modules/issues/341" + " (feel free to ignore this if it works for you)" + ) + fi + + if linux_chkconfig_present SYSFB_SIMPLEFB && + { linux_chkconfig_present FB_EFI || linux_chkconfig_present FB_VESA; } + then + warn+=( + " CONFIG_SYSFB_SIMPLEFB: is set, this may prevent FB_EFI or FB_VESA" + " from providing a working tty console display (ignore if unused)." + ) + fi + fi + + (( ${#warn[@]} )) && + ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" +} + +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 + + # 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=( + # nvidia_icd/layers(vulkan): skip with -X too as it uses libGLX_nvidia + $(usev !X " + libGLX_nvidia libglxserver_nvidia + nvidia_icd.json nvidia_layers.json") + $(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 general information on using ${PN}, please see: +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" + 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