From 770d63f36dbe1722e0ff9ab55eeca49986f01527 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 15 Feb 2025 00:13:03 +0000 Subject: gentoo auto-resync : 15:02:2025 - 00:13:02 --- x11-drivers/nvidia-drivers/Manifest | 8 +- .../nvidia-drivers/nvidia-drivers-550.40.83.ebuild | 567 --------------------- .../nvidia-drivers/nvidia-drivers-550.40.85.ebuild | 567 +++++++++++++++++++++ .../nvidia-drivers-570.86.16-r1.ebuild | 8 +- 4 files changed, 574 insertions(+), 576 deletions(-) delete mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-550.40.83.ebuild create mode 100644 x11-drivers/nvidia-drivers/nvidia-drivers-550.40.85.ebuild (limited to 'x11-drivers/nvidia-drivers') diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index f8604ddc7737..1f18a12164ab 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -27,7 +27,7 @@ DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb9049 DIST NVIDIA-Linux-x86_64-470.256.02.run 272850014 BLAKE2B 0fdc867f92b82b2a60810c3b43751cad7ac2c39928c92c6c343c0c6044f4d7d923d93b8599db3f7c999c0ee7d16940e65d991a61cbb30e1d9e49c5639ac6bdc8 SHA512 a837946dd24d7945c1962a695f1f31965f3ceb6927f52cd08fd51b8db138b7a888bbeab69243f5c8468a7bd7ccd47f5dbdb48a1ca81264866c1ebb7d88628f88 DIST NVIDIA-Linux-x86_64-535.230.02.run 341903243 BLAKE2B 954ad0d390aa786a0a95298bd0c98a3b909074e5c7bc5d40a6a4fcea41d423ad1f429f175968c98f5e14c07cdf68d3340420f97269a36a0df41ace6ac8224cb5 SHA512 2154e28682fe1663dc64b18569c67839995d496a6c1b353fcdc17fc4520420c8d629d441312a6cedc054d6322a267d6f275d1daef210d2f24a179d931a4c99b8 DIST NVIDIA-Linux-x86_64-550.144.03.run 307272669 BLAKE2B 6d1daf41eb3f65071b42dc9bc5b8e0cf48170b03f3418c938f956ddb843f5a1e0f3d968b8825207e3237fa0490f0c29e3ffc4403b4558ef557dadf4fcf5ad17c SHA512 b7c4638695ef3e75043fd1726f0153ff0c140475f965d88c21f46d2909e68d023ebe6aa1e758ed81ab58440ba9a789e00b9b84200c03f00d429e11938a2bed65 -DIST NVIDIA-Linux-x86_64-550.40.83.run 312434216 BLAKE2B c197623e617851b0fe87ae10552144da92eec7bf1831be2e7054ced1c3d71f00dbebba4f9ee880d63d75f4f380a1b10c54bc58a92cbae5c51b755869653409f8 SHA512 091ac7c72d479ab59d9796341581792b3eb5be558869fa0afa39430ed0eeb357fd74ac278cc066c4adb36a6ec832dc583cf26551385c9eac532f3957e27e301e +DIST NVIDIA-Linux-x86_64-550.40.85.run 312478355 BLAKE2B 3c964d0ef54085af19faea7100a5b9c4f33dc85d9b6ab790559aa1d85a8657b9d4e8a48661ab492a3e886258e7d3bf9b671673bddd3a99d3e77b54bc8a3c34c0 SHA512 4eed26067290412ca8fb58aa50eeb1726a45c4a9e4ea9428f192e5787366d6b7d3743509036981a074964b7bf4095aa044efb1a5819ca8757a3ee16cd6f7ee29 DIST NVIDIA-Linux-x86_64-570.86.16.run 375504315 BLAKE2B 3fc5d4b9f8b64323399f201d4d9d896ff47593108d675e5d77a45255e7ca9354e6876e5b4dee1f59c6c933493fbbf9d35606016f83430c43c5fc54c82685f3f8 SHA512 415adf4609f093e8703dd6f2c03bc5cbd84270c694e67bb0ee72897ac18dddb0d8aaf8baaf47e8624a79c54a1f794126a3ddb10fae91784f05f1f32ba063b985 DIST NVIDIA-kernel-module-source-535.230.02.tar.xz 12527212 BLAKE2B fd641d03cf7b417f1300b39dc271b08c920d11861491c510ceb713aaf69f1b4d373a1b0417993a0483dc6b2cb1d3e2d176d9c23edf9586f129df13bef495ce0b SHA512 d9080f257312b6760140a7dad3bb8e1d6f5982e7b25b3e623a74c519a7c296b1a12eece07335fc79f2d209b790a8239df81948cdb4031852d6225c4768ae42c3 DIST NVIDIA-kernel-module-source-550.144.03.tar.xz 13544304 BLAKE2B d68c1bc8914289b5f90a7fabaec029394871175b0563d64416fe596d7dc30c35b607b3fca5c88d03e59f1944e44663810b20609fccaa32aee89ce79b9fb061e9 SHA512 5923c7e6cdc3d8bfe4cdaf079d07e26b638f35ffa6b7a6c74c5ca2f9478a757ca92a1ced5f5b105f8ec0a61ef792653460683dcd1069beafba68264fb180fb14 @@ -57,11 +57,11 @@ DIST nvidia-xconfig-470.256.02.tar.bz2 108698 BLAKE2B e468574e4bc57e7279d4120e2b DIST nvidia-xconfig-535.230.02.tar.bz2 111060 BLAKE2B a29389a0d73f66b47131ce420a8b0c06134737dc01c9175b146305fa1e534d4c8e722a3af73ec9e745de6e027810836e7a77a0c05e771b46932cf47ce03de198 SHA512 4d0f5e239b47dcccf9abb1208c74d2baff87d93ad8d691772353bc84a340ec1b097e4cc436109ebe063b8180baab39a8c713992eb48c9f76206d54b890a5381c DIST nvidia-xconfig-550.144.03.tar.bz2 111209 BLAKE2B 733058b0960b04212ad058616a93e79fbc1d18b51d7bf8b2cf9a5227fe1f5fbc2af1accd4043b71137a9c12ef534c454db9a8b46c1c707bc22fbf618d76c0dd2 SHA512 98c637a243bfd0a7f3154994b05400701d3b1ddfe8a38cf7782c237baa33f11cbc5be305b9bce8ac98813af1d37143cf96c13b3e6d3357c30d3f89a9be8bee0d DIST nvidia-xconfig-570.86.16.tar.bz2 111239 BLAKE2B 490638802c16634c6d21e22d81991327d7b4d45a918ad64b05e1191a99143a57bfc84beae2fb900149686b0adff94ede06c16711fb4f4d43a374c270d851d668 SHA512 0c1834a979e8771a6fe29a7e25640f1bb414b2f3db6529ad359079fb5b0db0681c67ab38490c0df9fcbf754a7a6ddcffc8dd7fb4f969214aa81f067a43cfd83f -DIST open-gpu-kernel-modules-550.40.83.tar.gz 13813581 BLAKE2B 5c841bb5949733b0baf43a08112bf4451893348a18a48f956abd5184a2a93d03d4a912e6ac19bafb711aa0694c7041946134c34144c34ea4280edc39903c88ea SHA512 8ffc1d034889c225d43ecd61bdd448a3cbf53a7ffef04a2fb4343c9df089f535431de797208330dd55db399109a36eb0f8665e78a53f60616d36ca063d6ce22a +DIST open-gpu-kernel-modules-550.40.85.tar.gz 13813204 BLAKE2B 651bcfe33c0956b62cd6d1da392407502358500c0e443296d71a654da8faa1064c6037d449d596c825c7fd949fe66f2f34334cab1c17c3abf79fd92d17b08d0d SHA512 fe66e51930fff737671cb81222856696ef3cb3e57d6c38e93f29284782124ea2e5eb1ac0e31ab95e211c662b7d12566f0346319ddca7f15efa3fc2e833feed20 EBUILD nvidia-drivers-390.157.ebuild 15132 BLAKE2B d34eea6ef22dd95e039c1cd6ce7d0f0e26a4258f4645bc58a2b6fdef4a40c0e9cc69b15ffbf1276b0616fe73d1a502f0ec8a0c2123b6d5691cc133011cfa7b2c SHA512 d0e00c462a39eff02a0952019f2b31f27846f651d83c26914804e8c33e53746c7cc403e2bcb3509572819aad2756b920e4ecee469bf0f9a580e645555b3aa770 EBUILD nvidia-drivers-470.256.02-r2.ebuild 16762 BLAKE2B c7295f0254504f72e1098f94e7af5f2219cf4e1d4491071ca9f0d3e05fcfc9815f45e25886908b6d4e8ae68da41ce49da69aba46278aa2db3fdc1b6a6632e61d SHA512 a0d28647b763030e639ac6f3575d98b39071c8fdfae57f117841710e1723a1b7d9270f8c4ba3cafe6f0b099a99928ddd3541ead5918a838b5936403696b439fb EBUILD nvidia-drivers-535.230.02.ebuild 20220 BLAKE2B 2e7e8a20b53a2adcc7df8ecb712406d351b29f5cb2d085193ad4d34d18819d0f51f9a5392f2728f21930d0ac6759e31a994350fe9e611f012e8450b7d03cb444 SHA512 cc2beb99362a845824d22002176be5a8172204c6657e3cf6efd1232fb3a89d4b8cfa1854c47cb202ea7f0bb0b526d0da76949e08741320f20c86861325409434 EBUILD nvidia-drivers-550.144.03.ebuild 19909 BLAKE2B 63edff31c1268973fe23eaadf0a1d60f94a09fb85a605564d6ee8cc13be1105e619a9aa4411d7a805f4a3d073a81ced53e5c9ce1e8c9e9bf142a0e36a35d2952 SHA512 896761ad0e1c02886b3a41014c81dbf5944dd4a942081bdc13503d916c2f9f91ab8ebf22290a1528a2ce21e141ecd70db1341c5875704c92101340aba6ebac4b -EBUILD nvidia-drivers-550.40.83.ebuild 19809 BLAKE2B 63d1f538d12840d52c52dcfc5da3e5fd0c3dad975c01d3318b882ce683a690bc5054dcc032a397d23adfba884aede8e788de3c605190e19c6743f708bacf33a9 SHA512 37c89e9c633e98159686843576492c1ace4041f993a106260015e284275a555d4bbe019e44176145d9fb38142308b0e96fa8cf0687e6e5ec320272e11b7c9f6a -EBUILD nvidia-drivers-570.86.16-r1.ebuild 21661 BLAKE2B e36a8847bf35fab97f33e47fd8ff3559f55ee23d7f37719040bc7b5312f4962c38dfca4d4d4d9a4968f949350739d37915eb58cb192de4b443ab9836513d433c SHA512 04ddc1bd4ec918ae2a3461495b6bfa6e10647625eab8ae00b267cf9df92457a855b720e8f0080d1718c473c669be5d498073df30f39338279662dd192bfaea5c +EBUILD nvidia-drivers-550.40.85.ebuild 19809 BLAKE2B 63d1f538d12840d52c52dcfc5da3e5fd0c3dad975c01d3318b882ce683a690bc5054dcc032a397d23adfba884aede8e788de3c605190e19c6743f708bacf33a9 SHA512 37c89e9c633e98159686843576492c1ace4041f993a106260015e284275a555d4bbe019e44176145d9fb38142308b0e96fa8cf0687e6e5ec320272e11b7c9f6a +EBUILD nvidia-drivers-570.86.16-r1.ebuild 21613 BLAKE2B 88b608d5b6ebdb734f2621763721ecb630f82b97267a1c8448bec45d516da37964ac796d6975aa9c1a5eece13ebfee0bbb8481b88a21b14028b9f5591d45f693 SHA512 fb2a368902c742d4979c7c7e637aaf60a92baa8e5041db22c161c77e4e18b1673ee3c7d80d6bb6935ed345af649af2a214779f22333a8ea7b97d2477b72ab936 MISC metadata.xml 1508 BLAKE2B b2cbb75ef3a4571f994ba5aaa5120a1e9e8bcac2405a48138346a10109a60e0ebbfd9e6b17e349268c669cc64988dc72edaed6fd2f0672e6dd4d090c454b8939 SHA512 378c7dbc14f63a6ebcea931f80aa6534762e0d9efa3d6c1e336872342139a191f63fea61d85b5d8dc0e4287326f3078a25a53d0bad532bd668014c4a21cae224 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.83.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.83.ebuild deleted file mode 100644 index 95f15a1ddcbf..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.83.ebuild +++ /dev/null @@ -1,567 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MODULES_OPTIONAL_IUSE=+modules -inherit desktop eapi9-pipestatus flag-o-matic linux-mod-r1 readme.gentoo-r1 -inherit systemd toolchain-funcs unpacker user-info - -MODULES_KERNEL_MAX=6.12 -NV_PIN=550.144.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 powerd +static-libs +tools wayland" -REQUIRED_USE="kernel-open? ( modules )" - -COMMON_DEPEND=" - acct-group/video - 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(-)?] - ) - powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) - wayland? ( - gui-libs/egl-gbm - >=gui-libs/egl-wayland-1.1.10 - ) -" -DEPEND=" - ${COMMON_DEPEND} - static-libs? ( - x11-base/xorg-proto - 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-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch - "${FILESDIR}"/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK - get_version - require_configured_kernel - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~SYSVIPC - ~!LOCKDEP - ~!PREEMPT_RT - ~!SLUB_DEBUG_ON - !DEBUG_MUTEXES - $(usev powerd '~CPU_FREQ') - " - - kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && - CONFIG_CHECK+=" DRM_TTM_HELPER" - - use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 - - use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 - - local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or - DRM_AMDGPU=m (among others, consult the kernel config's help), can - also use DRM_NOUVEAU=m as long as built as module *not* built-in." - 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. - ${drm_helper_msg}" - local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using - kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. - ${drm_helper_msg}" - 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." - local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and - will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is - set. Please do not report issues if run into e.g. kernel panics while - ignoring this." - - 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 - 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-545.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 -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - - local xnvflags=-fPIC #840389 - # lto static libraries tend to cause problems without fat objects - tc-is-lto && 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} - - # conftest.sh is broken with c23 due to func() changing meaning, - # and then fails later due to ealier misdetections - # TODO: try without now and then + drop modargs' CC= (bug #944092) - KERNEL_CC+=" -std=gnu17" - - 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=( - CC="${KERNEL_CC}" # needed for above gnu17 workaround - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - ) - - # temporary workaround for bug #914468 - 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 - [VULKANSC_ICD_JSON]=/usr/share/vulkansc - [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") - 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) - $(usev !powerd powerd) - 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} - pipestatus || die - 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 powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - - # enabling is needed for sleep to work properly and little reason not to do - # it unconditionally for a better user experience - : "$(systemd_get_systemunitdir)" - local unitdir=${_#"${EPREFIX}"} - # not using relative symlinks to match systemd's own links - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service - # also add a custom elogind hook to do the equivalent of the above - exeinto /usr/lib/elogind/system-sleep - newexe "${FILESDIR}"/system-sleep.elogind nvidia - # =systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 - insinto "${unitdir}"/systemd-homed.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false - EOF - insinto "${unitdir}"/systemd-suspend.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false - EOF - dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - - # 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 others (bug #904292,#921578) - # 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/nvidia-caps:/dev/char"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi -} - -pkg_preinst() { - has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= - 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 && [[ ! -v NV_HAD_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-550.40.85.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.85.ebuild new file mode 100644 index 000000000000..95f15a1ddcbf --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.85.ebuild @@ -0,0 +1,567 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop eapi9-pipestatus flag-o-matic linux-mod-r1 readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.12 +NV_PIN=550.144.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 powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + 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(-)?] + ) + powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) + wayland? ( + gui-libs/egl-gbm + >=gui-libs/egl-wayland-1.1.10 + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-base/xorg-proto + 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-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch + "${FILESDIR}"/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK + get_version + require_configured_kernel + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!PREEMPT_RT + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + $(usev powerd '~CPU_FREQ') + " + + kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && + CONFIG_CHECK+=" DRM_TTM_HELPER" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or + DRM_AMDGPU=m (among others, consult the kernel config's help), can + also use DRM_NOUVEAU=m as long as built as module *not* built-in." + 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. + ${drm_helper_msg}" + local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using + kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. + ${drm_helper_msg}" + 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." + local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and + will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is + set. Please do not report issues if run into e.g. kernel panics while + ignoring this." + + 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 + 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-545.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 +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && 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} + + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + 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=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + ) + + # temporary workaround for bug #914468 + 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 + [VULKANSC_ICD_JSON]=/usr/share/vulkansc + [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") + 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) + $(usev !powerd powerd) + 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} + pipestatus || die + 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 powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience + : "$(systemd_get_systemunitdir)" + local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # =systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + + # 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 others (bug #904292,#921578) + # 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/nvidia-caps:/dev/char"' + + # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure + # our settings are used for bug 932781#c8 and nouveau blacklist if either + # modules are included (however, just best-effort without initramfs regen) + if use modules; then + echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ + "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die + fi +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + 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 && [[ ! -v NV_HAD_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-570.86.16-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-570.86.16-r1.ebuild index 3847604073bf..8ab5188a52b0 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-570.86.16-r1.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-570.86.16-r1.ebuild @@ -4,8 +4,8 @@ EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop eapi9-pipestatus flag-o-matic linux-mod-r1 readme.gentoo-r1 -inherit systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 +inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info MODULES_KERNEL_MAX=6.13 NV_URI="https://download.nvidia.com/XFree86/" @@ -593,9 +593,7 @@ pkg_postinst() { elog "Of note, may possibly cause issues with SLI and Reverse PRIME." fi - if use !kernel-open && [[ ${REPLACING_VERSIONS##* } ]] && - ver_test ${REPLACING_VERSIONS##* } -lt 555 - then + if use !kernel-open && ver_replacing -lt 555; then elog elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" elog "enables the use of the GSP firmware by default. *If* experience regressions," -- cgit v1.2.3