summaryrefslogtreecommitdiff
path: root/x11-drivers/nvidia-drivers
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers/nvidia-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/Manifest10
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-470.conf8
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-545.conf8
-rw-r--r--x11-drivers/nvidia-drivers/files/system-sleep.elogind7
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild (renamed from x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild)11
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r3.ebuild (renamed from x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild)70
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05.ebuild (renamed from x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild)70
7 files changed, 168 insertions, 16 deletions
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
index 5af3f879..db739604 100644
--- a/x11-drivers/nvidia-drivers/Manifest
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -1,15 +1,15 @@
DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a
DIST NVIDIA-Linux-x86_64-470.256.02.run 272850014 BLAKE2B 0fdc867f92b82b2a60810c3b43751cad7ac2c39928c92c6c343c0c6044f4d7d923d93b8599db3f7c999c0ee7d16940e65d991a61cbb30e1d9e49c5639ac6bdc8 SHA512 a837946dd24d7945c1962a695f1f31965f3ceb6927f52cd08fd51b8db138b7a888bbeab69243f5c8468a7bd7ccd47f5dbdb48a1ca81264866c1ebb7d88628f88
-DIST NVIDIA-Linux-x86_64-550.107.02.run 307251605 BLAKE2B 767300982ac4b28fc731b250141cd0f5e9531424dcecd816e995c6fe63a8e2c15c0a42f9324f93c19da12868fd48abbaa15a1de752b675b88fa45a3c4385f40a SHA512 da0a15f87a4e6562f9a5e087a76b92de873db4849c8fdbf57d7dfe9d524e55dfbd578aef38d8818b9cb712a905a31fd0b97e399c74613943810545c92cf30f9d
+DIST NVIDIA-Linux-x86_64-550.127.05.run 307139930 BLAKE2B 6c6bfbc4383a3a9b61e73a4bc54062d29f6cc48b209263f772bca64301f04a2f692a55f6f493762a0770d88873f8231e29c6b73d3d68263624c7daf304008afe SHA512 b67364c0911aa4908192846ed855571312c9e29c47cae8c83300caf71a9c8c7277f2a0591f0c0dd669f34464e04cf420a16ec83f5db4875a32c00a678db80d06
DIST nvidia-installer-390.157.tar.bz2 150323 BLAKE2B 8058ca87a6dea956d564af9f7eab9b1fc82b1f2382bd5cb2f6d97cbe2e19292533522d5f8f2eacbeb16520372715fcb72f8f9b0998962af5d4e75522c8d74524 SHA512 93a7ece648602157496c8e27a88864ede341a100f5328a4c1a25faf8f0b94d252060e5e2f71d0c302fd0566c10773c30b76b3b5f431d8039b71c90a7969f7d7e
DIST nvidia-installer-470.256.02.tar.bz2 146269 BLAKE2B 4402e725c8fd0157eb84d4ec140a33f97e873014577487ef1e32fb8921cabe79c60ff46532e5bfaabb2b6ac894f7c80086dbab19e61906e2e27346fb85f98829 SHA512 c962dc17d9696256d1ebedcaeb3010994f2ce3895aedc47987599ebfec132a9b9a249d2ece6502b15bd4a93f9b0106aa13487a7da5f64199c274ce11eba27cfd
-DIST nvidia-installer-550.107.02.tar.bz2 155423 BLAKE2B 5bd3d57dfd9ca70c38908f5b397d71802bd78ca1de4c6d9b32de147e39adac61028ca56848b2cb10f13717046204b690c86c880034d1f386df9298e7f15c4b65 SHA512 2120f31f9ab92bb3a8da6991c4d5df6cf50ed81e5c6eadcf23f6af98f08ef674e137ac2bf62f1bf76d94f005d0fc9ef2a130d2e606fca929229f358ac51377d1
+DIST nvidia-installer-550.127.05.tar.bz2 155613 BLAKE2B 6731d9d70b436202d1c92c026cef46bf03ed025b3032583b27e5eeb98440285516b6a097fe41a18ffb44a63260c4450db2fe419c758ded4f9e90a30cf95cd27a SHA512 e0a271365df8a4f1c0ff7116b5353ec407d305d1783a9834b0cbaa935e75d3b3960ef595c9ef24ad6c8b936fcff5dd43fcace102a0fb0e2cd7d844ada6c44aaa
DIST nvidia-modprobe-390.157.tar.bz2 35306 BLAKE2B 80d202b39c2f95ec0f909712c2e101483af50124092c32efb33bd98ff58ddfb97b737ff07f1ddc941f688c1b4c26a15f392566d522e18506771f10422fcd571c SHA512 109bbe24a3758b568ea65fe1e9d78f69fae6108ec0497b796c885a3912825fe04ffd7389a3e22987f1a10a2926bf6eaa384faabc59478aa3ee244dd3ac91c6d3
DIST nvidia-modprobe-470.256.02.tar.bz2 38769 BLAKE2B 0db444b09b0b6d24c04877fae95249e781d82b3141f90eb05d869b64d2b6e65ad00bf44c4e427c64dbd4765fa99a8699f80a1d95b00c66137a54dc878d7ea298 SHA512 c1cbfa6c8e188e5a5eb5d390b9a903406cbff103d212fc30e611e4023be3fde896ad84e8bb45b030beb5d1bcd8155c9e55a8f9636c45ce1e2a5c03f672989a31
-DIST nvidia-modprobe-550.107.02.tar.bz2 41486 BLAKE2B 4c74caa2f91bda9ad96e6366986e2934776cc31ae3b0dd596fe5d0392cf023a766e2fb2fc765d5886e872935028fda0836df1826fdeea2e2a76701420021778e SHA512 6fc755b50f6ccf25812ed6936560784a7ea5766152f04631829b192a070b47ba68296bc215b60d1f7a9773f2db6388214d55e115794db8cf944a6f64d19ce34f
+DIST nvidia-modprobe-550.127.05.tar.bz2 41498 BLAKE2B 387945fe05f244350ec2982b6a723ba34ed8c726865ed95c2a33702233db3eb6e1937673f3eee72632bb0db6de6cc6c0dbc07abe909491187e8da6ebd2582840 SHA512 c229d3018589d9f52f17baa4d8eee966a198051058019f577d0455b67d0189c586b8ed64273859e4cf7d4a37cd6f6fb21aa53a8e2fe4cd926de34106e87bae6a
DIST nvidia-persistenced-390.157.tar.bz2 48654 BLAKE2B 2cf6c92da90acff55e8c180a06b0c6a29d48be9fd8ca3c541202fd14f0697220fba6b66452942aa7ae7cc8821f5c5eb9fa8f7a31d2248624e5f9141d83a176b8 SHA512 70f0707ed6f2b877e69ef90cf782f66cbc9d2071db53ca09ceb7b89427b0fe176708517340621fa251539b7d481b238adeeb60261674eed74de1f62db6dbb72e
DIST nvidia-persistenced-470.256.02.tar.bz2 46567 BLAKE2B 8f837322a3b88412fd2f6acf38721b49a6cb444fbd842d652519e5596f2e545d8f06bbdf017f46a22301ce87455f96147fab2829ca5fbf26131ec3e4a772e282 SHA512 4fd19258649b7d39945fb5c8578bf11ab118617dd14f3d11cdf15cb3fe77daf7b4719e4ae57af59031b1b809d02f4e8e8afed0ec60b9d0aed4d2488bd3013cd9
-DIST nvidia-persistenced-550.107.02.tar.bz2 49661 BLAKE2B 695bcf0211194263b38444305c5b6bd6a13331ab57c05bd85d9ea5e007af37e34b96bc450fbcb92bb12050d75c3885d51563fdc2a827f25a433283b067e204ee SHA512 6b398f53a3670d73c13be364d1c7acd563878ebe1162ff5fd0f1f3749c20284a8dd9d98cadccf1fc0b354f353006a3dd2acfd066f98601e6fe1577f0dc59631f
+DIST nvidia-persistenced-550.127.05.tar.bz2 61307 BLAKE2B 5e6f8d6734062b45782b71ebc8a3d17eb9cd56bef532f89ba27e4828c3f51b1c3ad94323f3e8d331cfa9b225f406f58d13ac36dc0976f0a7de955a35fd3acb38 SHA512 00d1a0436afdc9c3abe3abd68f29cec20c4ef38e8f96b8b36bd5428636ad085b42109591438b4d3a776f1f9b6efdef0e97dc964bd0e2b95c740b50d821e9311d
DIST nvidia-xconfig-390.157.tar.bz2 107399 BLAKE2B 0cbb3b1ba508ddc3ba4a161c290b31bf7a67f67880bdbd01171a962c5fa97ca945b1ef17932403f8589309380743f1da632c728d8accb6d4e56dbd895e7486bb SHA512 50b390811c9bf091b14add41f886925b17496b41006b7d3981d2398caa65cf5db8a579c8cebed78278384bf3acc629befb07b54339c61abcc75852c0dcb8b8ca
DIST nvidia-xconfig-470.256.02.tar.bz2 108698 BLAKE2B e468574e4bc57e7279d4120e2b08a201671b50d408be0c530eabe5da7d45daaf21cbf5c7fa31410d0d732fe8ea1551cbfb21d1ae193c1b3f5b5c50c764c9e236 SHA512 9dcec1e0c2b56b4d38a5f2c76086302f8bc0860cc15012cce29c3a5062f801a48b6a2bb78344361b07a2717b58502783441a2daf402d9973a17526175b1f15ca
-DIST nvidia-xconfig-550.107.02.tar.bz2 111170 BLAKE2B dbf2b0b7f7b71f17ce5a0b6ae1c5346a573ea11163b24c4bce1b18281d4af70f38458bc122c39ad948242a8cfc37b68e696141b8dd3ce16f9ae7fb3fb61af735 SHA512 a7b9ba8d542041b273deaeb354c398fba4241dfdcf68be71e1c1138c925206db0f7ce2945c5ec92eddbcdbf240c5340802b3989e6140593828d1eb79854730e3
+DIST nvidia-xconfig-550.127.05.tar.bz2 111217 BLAKE2B a687e3e1d9e77cb5153a9732beade8c007d11fdada22cdd0a9debe464d9ac5125b435c95565f66c8cf895a9656e66ae37384b11a43e2f0785daf509746b57d62 SHA512 ff1a151663621320c32df1593c13e70d17d06f9d9633ea6c57463c0dd73873f8afc73676c393fdca82d7aa5085000e6b3af420228712e4c226b7b24220c454ec
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
index a20f2a19..1ba489dd 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-470.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf
@@ -11,10 +11,12 @@ alias nouveau off
# Enabling may possibly cause issues with SLI and Reverse PRIME.
#options nvidia-drm modeset=1
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
options nvidia \
- NVreg_PreserveVideoMemoryAllocations=0 \
+ NVreg_PreserveVideoMemoryAllocations=1 \
NVreg_TemporaryFilePath=/var/tmp
# !!! Security Warning !!!
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-545.conf b/x11-drivers/nvidia-drivers/files/nvidia-545.conf
index ecb549e1..e8ca7805 100644
--- a/x11-drivers/nvidia-drivers/files/nvidia-545.conf
+++ b/x11-drivers/nvidia-drivers/files/nvidia-545.conf
@@ -16,10 +16,12 @@ alias nouveau off
# experimental, "may" cause issues X mode switching, sleep, or more).
#options nvidia-drm fbdev=1
-# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's
-# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend).
+# Suspend options. Note that Allocations=1 requires suspend hooks currently
+# only used when either systemd or elogind is used to suspend. If using
+# neither or have issues, try Allocations=0 (revert if it does not help
+# as =0 is not recommended).
options nvidia \
- NVreg_PreserveVideoMemoryAllocations=0 \
+ NVreg_PreserveVideoMemoryAllocations=1 \
NVreg_TemporaryFilePath=/var/tmp
# !!! Security Warning !!!
diff --git a/x11-drivers/nvidia-drivers/files/system-sleep.elogind b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
new file mode 100644
index 00000000..d36e2697
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/system-sleep.elogind
@@ -0,0 +1,7 @@
+#!/bin/sh
+case ${1-} in
+ pre) nvidia-sleep.sh suspend;;
+ # run in background given resume is flaky if elogind did not finish
+ post) nvidia-sleep.sh resume &;;
+ *) exit 1;;
+esac
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild
index bdf740c4..be15e1fb 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r9.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157-r11.ebuild
@@ -89,7 +89,7 @@ pkg_setup() {
Please ignore if not having issues, but otherwise try to unset or
pass ibt=off to the kernel's command line." #911142
- kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+ CONFIG_CHECK+=" X86_PAT" #817764
}
src_prepare() {
@@ -307,6 +307,15 @@ documentation that is installed alongside this README."
# manually if need others or addwrite)
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"'
+
+ # Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
+ # to ensure that the nouveau blacklist is applied
+ # https://github.com/dracut-ng/dracut-ng/issues/674
+ # https://bugs.gentoo.org/932781
+ if use dkms; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
+ fi
}
_dracut_initramfs_regen() {
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r3.ebuild
index e9e45d49..db4c9dcb 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r3.ebuild
@@ -88,7 +88,7 @@ pkg_setup() {
broken CUDA/NVENC. Please ignore if not having issues, but otherwise
try to unset or pass ibt=off to the kernel's command line." #911142
- kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+ CONFIG_CHECK+=" X86_PAT" #817764
}
src_prepare() {
@@ -171,7 +171,8 @@ src_install() {
)
local skip_modules=(
$(usev !X "nvfbc vdpau xdriver")
- installer gsp nvpd # handled separately / built from source
+ $(usev !dkms gsp)
+ installer nvpd # handled separately / built from source
)
local skip_types=(
GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
@@ -272,6 +273,22 @@ documentation that is installed alongside this README."
dobin nvidia-bug-report.sh
+ # 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
+ # <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+ # TODO: cleanup after 255.5 been stable for a few months
+ dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
# 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
@@ -285,6 +302,15 @@ documentation that is installed alongside this README."
# ebuilds should handle manually if need others or addwrite)
insinto /etc/sandbox.d
newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"'
+
+ # Dracut does not include /etc/modprobe.d if hostonly=no, but we do need this
+ # to ensure that the nouveau blacklist is applied
+ # https://github.com/dracut-ng/dracut-ng/issues/674
+ # https://bugs.gentoo.org/932781
+ if use dkms; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
+ fi
}
_dracut_initramfs_regen() {
@@ -312,6 +338,46 @@ pkg_postinst() {
ewarn "this may lead to system instability/freezes with this version of"
ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
fi
+
+ # these can be removed after some time, only to help the transition
+ # given users are unlikely to do further custom solutions if it works
+ # (see also https://github.com/elogind/elogind/issues/272)
+ if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+ then
+ ewarn
+ ewarn "!!! WARNING !!!"
+ ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+ ewarn "This 'could' cause issues if used in combination with the new hook"
+ ewarn "installed by the ebuild to handle sleep using the official upstream"
+ ewarn "script. It is recommended to disable the option."
+ fi
+ if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+ xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+ then
+ ewarn
+ ewarn "!!! WARNING !!!"
+ ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+ ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+ ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+ ewarn "to remove the custom one to avoid potential issues."
+ ewarn
+ ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+ ewarn "scripts can be used together. The warning will be removed in the future."
+ fi
+ if [[ ${REPLACING_VERSIONS##* } ]] &&
+ ver_test ${REPLACING_VERSIONS##* } -lt 470.256.02-r1 # may get repeated
+ then
+ elog
+ elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+ elog "with this version of ${PN}. This is recommended (or required) by"
+ elog "major DEs especially with wayland but, *if* experience regressions with"
+ elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+ elog
+ elog "May notably be an issue when using neither systemd nor elogind to suspend."
+ elog
+ elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+ elog "default, and for openrc+elogind a similar hook has been installed."
+ fi
}
pkg_postrm() {
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05.ebuild
index 5d60b6a8..f86871e4 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.127.05.ebuild
@@ -88,7 +88,7 @@ pkg_setup() {
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."
- kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764
+ CONFIG_CHECK+=" X86_PAT" #817764
CONFIG_CHECK+=" MMU_NOTIFIER" #843827
local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but required.
@@ -178,8 +178,9 @@ src_install() {
)
local skip_modules=(
$(usev !X "nvfbc vdpau xdriver")
+ $(usev !dkms gsp)
$(usev !powerd powerd)
- installer gsp nvpd # handled separately / built from source
+ installer nvpd # handled separately / built from source
)
local skip_types=(
GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd
@@ -292,6 +293,22 @@ documentation that is installed alongside this README."
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
+ # <elogind-255.5 used a different path (bug #939216), keep a compat symlink
+ # TODO: cleanup after 255.5 been stable for a few months
+ dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia
+
# 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
@@ -305,6 +322,15 @@ documentation that is installed alongside this README."
# 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 include /etc/modprobe.d if hostonly=no, but we do need this
+ # to ensure that the nouveau blacklist is applied
+ # https://github.com/dracut-ng/dracut-ng/issues/674
+ # https://bugs.gentoo.org/932781
+ if use dkms; then
+ echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \
+ "${ED}/usr/lib/dracut/dracut.conf.d/10-${PN}.conf" || die
+ fi
}
_dracut_initramfs_regen() {
@@ -332,6 +358,46 @@ pkg_postinst() {
ewarn "this may lead to system instability/freezes with this version of"
ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
fi
+
+ # these can be removed after some time, only to help the transition
+ # given users are unlikely to do further custom solutions if it works
+ # (see also https://github.com/elogind/elogind/issues/272)
+ if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null
+ then
+ ewarn
+ ewarn "!!! WARNING !!!"
+ ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/."
+ ewarn "This 'could' cause issues if used in combination with the new hook"
+ ewarn "installed by the ebuild to handle sleep using the official upstream"
+ ewarn "script. It is recommended to disable the option."
+ fi
+ if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep | sort | uniq | \
+ xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]]
+ then
+ ewarn
+ ewarn "!!! WARNING !!!"
+ ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep"
+ ewarn "referencing NVIDIA. This version of ${PN} has installed its own"
+ ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended"
+ ewarn "to remove the custom one to avoid potential issues."
+ ewarn
+ ewarn "Feel free to ignore this warning if you know the other NVIDIA-related"
+ ewarn "scripts can be used together. The warning will be removed in the future."
+ fi
+ if [[ ${REPLACING_VERSIONS##* } ]] &&
+ ver_test ${REPLACING_VERSIONS##* } -lt 470.256.02-r1 # may get repeated
+ then
+ elog
+ elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default"
+ elog "with this version of ${PN}. This is recommended (or required) by"
+ elog "major DEs especially with wayland but, *if* experience regressions with"
+ elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'."
+ elog
+ elog "May notably be an issue when using neither systemd nor elogind to suspend."
+ elog
+ elog "Also, the systemd suspend/hibernate/resume services are now enabled by"
+ elog "default, and for openrc+elogind a similar hook has been installed."
+ fi
}
pkg_postrm() {