Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-drivers/nvidia-drivers/
Date: Sat, 09 Oct 2021 12:06:24
Message-Id: 1633781066.bb18661c4924a8edcabf15928d8bf22e1d499a8a.ionen@gentoo
1 commit: bb18661c4924a8edcabf15928d8bf22e1d499a8a
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 9 10:47:19 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 9 12:04:26 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb18661c
7
8 x11-drivers/nvidia-drivers: add 470.62.05 from vulkan branch
9
10 This branch is primarily aimed at vulkan developers or those
11 wanting to try new vulkan features ahead of time.
12
13 It may be buggier or less secure (typically not always up to
14 date with the main branch), and thus will always stay masked
15 only for those that really want it.
16
17 Multiple branches (455.xx, 470.xx, etc...) for these will not
18 be kept and will use the latest with :0/vulkan subslot for
19 easy identification.
20
21 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
22
23 x11-drivers/nvidia-drivers/Manifest | 1 +
24 .../nvidia-drivers/nvidia-drivers-470.62.05.ebuild | 476 +++++++++++++++++++++
25 2 files changed, 477 insertions(+)
26
27 diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
28 index 56b1e2e74f1..813b0deb044 100644
29 --- a/x11-drivers/nvidia-drivers/Manifest
30 +++ b/x11-drivers/nvidia-drivers/Manifest
31 @@ -4,6 +4,7 @@ DIST NVIDIA-Linux-aarch64-470.74.run 183973692 BLAKE2B dd5e637161b1880e77ce1ac9d
32 DIST NVIDIA-Linux-x86-390.144.run 49210937 BLAKE2B b7e6edb55af88be74e4322ff1d270388a60a9d9809314c3a0502f86ed97edb99dfcdd3c81c5f51e681c8fcc47ecbfecd124b4d733141d23726226a3965b4c1f1 SHA512 d962c7e7b4b9c4635a887767d34a49c401a89e5975a5e57fa83366ca824ab70d5b8a81f3dce2e05e0528afddc72d70b2fcd69a216bd16d75e7b88ec704390546
33 DIST NVIDIA-Linux-x86_64-390.144.run 85000417 BLAKE2B 8ecfa768fb8fe92170ff5b82698a7fb22da8bc557ab2036464bf5650b6fffc7028e25a68e1f5638f6bc171eb45a4aba459465490c7a99aacd36dc769994062e8 SHA512 9503ebf41037a14deba995288a364768cb03fb682de8653a4b0c05955b23603443c41c4216c93eac7d7efc301734416012864ede728324ab47b93ff167d93da4
34 DIST NVIDIA-Linux-x86_64-460.91.03.run 178201292 BLAKE2B 4d407b7bb3a99ab71c62c3cd18dc3549c98a24e7af28276e6e6a21dd33efcab017fed3f782f6dfb060c4437cd718f19c2f9900de367cc47bf19fa2718a18ad55 SHA512 4ac11130fe5a8f1c26f459e9c19660b3ff6f23011e9f77b09ca948fc42609e523ecea70d3bf6def50a75b4a3079ab280018753fb6e53875d9bb8093a033e3b70
35 +DIST NVIDIA-Linux-x86_64-470.62.05.run 271634590 BLAKE2B a37d33d188e9e36c5bfb3ba48af257c76fa58e482733d96326220028a073656a45f7eb40939a54bdfc6fc0df0eec610d5efac54dac83251975ccfeb287457aec SHA512 413b2d2c9d29d91c81f9696c17eb04fce0d7bf00a54779f86ceb16b59c32479a34c4d5a29222e095a8bddbfcafd90af0451493f0cb82a0d268a9160795bbe8d1
36 DIST NVIDIA-Linux-x86_64-470.63.01.run 271484294 BLAKE2B 7769f53897dccea716d459a12808d1f5a738072415639063e47dee82b489bb17121516cf585c1bb6b39f71b11f62f636a466284aba5854a5cfb4f553353cf8d3 SHA512 d3dadf93df86e5462ecb4ae6a04f03b05bf1450ad91e8c2aa73e838ddc9aa11b4e926fc32714d32bd7c606498fee5a54c77d5e40ecc08a039d3e9c2d331ad454
37 DIST NVIDIA-Linux-x86_64-470.74.run 270479241 BLAKE2B dacae4273d67fb9a2ab9ce4d0a6cb6255935abc5dacc7381f33c249ffeb515c84cb88f6c92f9a5bff23a92a55952525fe85594cd67fa4319c046a2e38dd26be6 SHA512 21e4290d98bbbf09eed7be32df8743f0adf728f9e88869afb02fc1d0f0be87cf42af2d4f04322a76d68a1704ef044e83cd403377e60af917ff3ec0a04985801a
38 DIST nvidia-installer-390.144.tar.bz2 150017 BLAKE2B 1a633594ecb9b54ee5a1e3620263a95db30c1ddebf547ecc7f267e1f0b799bcdb44cc3ddd6c96eda085d9be5c8f691e92556296f250495d80eec0c2f155f5bd5 SHA512 e4c624afc18bd1d61264f93bdcbc72afe42687baadf31683a6dd11a45c6257f6a5185b91f4b3d4c0316b8eb03ed79511f9ad260ee9e6f299fc136f5dc2178e42
39
40 diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.05.ebuild
41 new file mode 100644
42 index 00000000000..9f201131b30
43 --- /dev/null
44 +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.05.ebuild
45 @@ -0,0 +1,476 @@
46 +# Copyright 1999-2021 Gentoo Authors
47 +# Distributed under the terms of the GNU General Public License v2
48 +
49 +EAPI=7
50 +
51 +MODULES_OPTIONAL_USE="driver"
52 +inherit desktop linux-info linux-mod multilib-build \
53 + readme.gentoo-r1 systemd toolchain-funcs unpacker
54 +
55 +NV_KERNEL_MAX="5.14"
56 +NV_URI="https://download.nvidia.com/XFree86/"
57 +NV_PIN="470.63.01"
58 +
59 +DESCRIPTION="NVIDIA Accelerated Graphics Driver"
60 +HOMEPAGE="https://www.nvidia.com/download/index.aspx"
61 +SRC_URI="
62 + https://developer.nvidia.com/vulkan-beta-${PV//./}-linux -> NVIDIA-Linux-x86_64-${PV}.run
63 + ${NV_URI}nvidia-installer/nvidia-installer-${NV_PIN}.tar.bz2
64 + ${NV_URI}nvidia-modprobe/nvidia-modprobe-${NV_PIN}.tar.bz2
65 + ${NV_URI}nvidia-persistenced/nvidia-persistenced-${NV_PIN}.tar.bz2
66 + ${NV_URI}nvidia-settings/nvidia-settings-${NV_PIN}.tar.bz2
67 + ${NV_URI}nvidia-xconfig/nvidia-xconfig-${NV_PIN}.tar.bz2"
68 +# nvidia-installer is unused but here for GPL-2's "distribute sources"
69 +S="${WORKDIR}"
70 +
71 +LICENSE="GPL-2 MIT NVIDIA-r2 ZLIB"
72 +SLOT="0/vulkan"
73 +KEYWORDS="-* ~amd64"
74 +IUSE="+X +driver static-libs +tools wayland"
75 +
76 +COMMON_DEPEND="
77 + acct-group/video
78 + acct-user/nvpd
79 + net-libs/libtirpc:=
80 + tools? (
81 + dev-libs/atk
82 + dev-libs/glib:2
83 + dev-libs/jansson
84 + media-libs/harfbuzz:=
85 + x11-libs/cairo
86 + x11-libs/gdk-pixbuf:2
87 + x11-libs/gtk+:3
88 + x11-libs/libX11
89 + x11-libs/libXext
90 + x11-libs/libXxf86vm
91 + x11-libs/pango
92 + )"
93 +RDEPEND="
94 + ${COMMON_DEPEND}
95 + X? (
96 + media-libs/libglvnd[X,${MULTILIB_USEDEP}]
97 + x11-libs/libX11[${MULTILIB_USEDEP}]
98 + x11-libs/libXext[${MULTILIB_USEDEP}]
99 + )
100 + wayland? (
101 + >=gui-libs/egl-wayland-1.1.7-r1
102 + media-libs/libglvnd
103 + )"
104 +DEPEND="
105 + ${COMMON_DEPEND}
106 + static-libs? (
107 + x11-libs/libX11
108 + x11-libs/libXext
109 + )
110 + tools? (
111 + media-libs/libglvnd
112 + sys-apps/dbus
113 + x11-base/xorg-proto
114 + x11-libs/libXrandr
115 + x11-libs/libXv
116 + x11-libs/libvdpau
117 + )"
118 +BDEPEND="
119 + app-misc/pax-utils
120 + virtual/pkgconfig"
121 +
122 +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
123 +
124 +PATCHES=(
125 + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
126 +)
127 +
128 +DOCS=(
129 + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json
130 + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt
131 +)
132 +HTML_DOCS=( html/. )
133 +
134 +pkg_setup() {
135 + use driver || return
136 +
137 + local CONFIG_CHECK="
138 + PROC_FS
139 + ~DRM_KMS_HELPER
140 + ~SYSVIPC
141 + ~!LOCKDEP
142 + ~!SLUB_DEBUG_ON
143 + !DEBUG_MUTEXES"
144 + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection
145 + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1.
146 + Cannot be directly selected in the kernel's menuconfig, so enable
147 + options such as CONFIG_DRM_FBDEV_EMULATION instead."
148 +
149 + MODULE_NAMES="
150 + nvidia(video:kernel)
151 + nvidia-drm(video:kernel)
152 + nvidia-modeset(video:kernel)
153 + nvidia-peermem(video:kernel)
154 + nvidia-uvm(video:kernel)"
155 +
156 + linux-mod_pkg_setup
157 +
158 + [[ ${MERGE_TYPE} == binary ]] && return
159 +
160 + BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"'
161 + BUILD_TARGETS="modules" # defaults' clean sometimes deletes modules
162 +
163 + if linux_chkconfig_present CC_IS_CLANG; then
164 + ewarn "Warning: building ${PN} with a clang-built kernel is experimental."
165 +
166 + BUILD_PARAMS+=' CC=${CHOST}-clang'
167 + if linux_chkconfig_present LD_IS_LLD; then
168 + BUILD_PARAMS+=' LD=ld.lld'
169 + if linux_chkconfig_present LTO_CLANG_THIN; then
170 + # kernel enables cache by default leading to sandbox violations
171 + BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
172 + fi
173 + fi
174 + fi
175 +
176 + if kernel_is -gt ${NV_KERNEL_MAX/./ }; then
177 + ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of nvidia-drivers"
178 + ewarn "or was not tested with it. It is recommended to use one of:"
179 + ewarn " <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}"
180 + ewarn " <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}"
181 + ewarn "You are free to try or use /etc/portage/patches, but support will"
182 + ewarn "not be given and issues wait until NVIDIA releases a fixed version."
183 + ewarn
184 + ewarn "Do _not_ file a bug report if run into issues."
185 + ewarn
186 + fi
187 +}
188 +
189 +src_prepare() {
190 + # make user patches usable across versions
191 + rm nvidia-modprobe && mv nvidia-modprobe{-${NV_PIN},} || die
192 + rm nvidia-persistenced && mv nvidia-persistenced{-${NV_PIN},} || die
193 + rm nvidia-settings && mv nvidia-settings{-${NV_PIN},} || die
194 + rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die
195 +
196 + default
197 +
198 + # prevent detection of incomplete kernel DRM support (bug #603818)
199 + sed 's/defined(CONFIG_DRM)/defined(CONFIG_DRM_KMS_HELPER)/' \
200 + -i kernel/conftest.sh || die
201 +
202 + sed -e '/Exec=\|Icon=/s/_.*/nvidia-settings/' \
203 + -e '/Categories=/s/_.*/System;Settings;/' \
204 + -i nvidia-settings/doc/nvidia-settings.desktop || die
205 +
206 + # remove gtk2 support (bug #592730)
207 + sed '/^GTK2LIB = /d;/INSTALL.*GTK2LIB/,+1d' \
208 + -i nvidia-settings/src/Makefile || die
209 +
210 + sed 's/__USER__/nvpd/' \
211 + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \
212 + > nvidia-persistenced.service || die
213 +
214 + # enable nvidia-drm.modeset=1 by default with USE=wayland
215 + cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die
216 + if use wayland; then
217 + sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die
218 + fi
219 +
220 + gzip -d nvidia-{cuda-mps-control,smi}.1.gz || die
221 +}
222 +
223 +src_compile() {
224 + nvidia-drivers_make() {
225 + emake -C nvidia-${1} ${2} \
226 + PREFIX="${EPREFIX}/usr" \
227 + HOST_CC="$(tc-getBUILD_CC)" \
228 + HOST_LD="$(tc-getBUILD_LD)" \
229 + NV_USE_BUNDLED_LIBJANSSON=0 \
230 + NV_VERBOSE=1 DO_STRIP= OUTPUTDIR=out
231 + }
232 +
233 + tc-export AR CC LD OBJCOPY
234 +
235 + # may no longer be relevant but kept as a safety
236 + export DISTCC_DISABLE=1 CCACHE_DISABLE=1
237 +
238 + use driver && linux-mod_src_compile
239 +
240 + nvidia-drivers_make modprobe
241 + nvidia-drivers_make persistenced
242 + use X && nvidia-drivers_make xconfig
243 +
244 + if use tools; then
245 + nvidia-drivers_make settings
246 + elif use static-libs; then
247 + nvidia-drivers_make settings/src out/libXNVCtrl.a
248 + fi
249 +}
250 +
251 +src_install() {
252 + nvidia-drivers_make_install() {
253 + emake -C nvidia-${1} install \
254 + DESTDIR="${D}" \
255 + PREFIX="${EPREFIX}/usr" \
256 + LIBDIR="${ED}/usr/$(get_libdir)" \
257 + NV_USE_BUNDLED_LIBJANSSON=0 \
258 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out
259 + }
260 +
261 + nvidia-drivers_libs_install() {
262 + local libs=(
263 + EGL_nvidia
264 + GLESv1_CM_nvidia
265 + GLESv2_nvidia
266 + cuda
267 + nvcuvid
268 + nvidia-allocator
269 + nvidia-compiler
270 + nvidia-eglcore
271 + nvidia-encode
272 + nvidia-glcore
273 + nvidia-glsi
274 + nvidia-glvkspirv
275 + nvidia-ml
276 + nvidia-opencl
277 + nvidia-opticalflow
278 + nvidia-ptxjitcompiler
279 + nvidia-tls
280 + )
281 +
282 + if use X; then
283 + libs+=(
284 + GLX_nvidia
285 + nvidia-fbc
286 + nvidia-ifr
287 + vdpau_nvidia
288 + )
289 + fi
290 +
291 + local libdir=.
292 + if [[ ${ABI} == x86 ]]; then
293 + libdir+=/32
294 + else
295 + libs+=(
296 + libnvidia-nvvm.so.4.0.0
297 + nvidia-cfg
298 + nvidia-ngx
299 + nvidia-rtcore
300 + nvoptix
301 + )
302 + use wayland && libs+=( nvidia-vulkan-producer )
303 + fi
304 +
305 + local lib soname
306 + for lib in "${libs[@]}"; do
307 + [[ ${lib:0:3} != lib ]] && lib=lib${lib}.so.${PV}
308 +
309 + # auto-detect soname and create appropriate symlinks
310 + soname=$(scanelf -qF'%S#F' ${lib}) || die "Scanning ${lib} failed"
311 + if [[ ${soname} && ${soname} != ${lib} ]]; then
312 + ln -s ${lib} ${libdir}/${soname} || die
313 + fi
314 + ln -s ${lib} ${libdir}/${lib%.so*}.so || die
315 +
316 + dolib.so ${libdir}/${lib%.so*}*
317 + done
318 + }
319 +
320 + if use driver; then
321 + linux-mod_src_install
322 +
323 + insinto /etc/modprobe.d
324 + doins "${T}"/nvidia.conf
325 +
326 + insinto /lib/firmware/nvidia/${PV}
327 + doins firmware/gsp.bin
328 +
329 + # used for gpu verification with binpkgs (not kept)
330 + insinto /usr/share/nvidia
331 + doins supported-gpus/supported-gpus.json
332 + fi
333 +
334 + if use X; then
335 + exeinto /usr/$(get_libdir)/xorg/modules/drivers
336 + doexe nvidia_drv.so
337 +
338 + exeinto /usr/$(get_libdir)/xorg/modules/extensions
339 + newexe libglxserver_nvidia.so{.${PV},}
340 +
341 + insinto /usr/share/X11/xorg.conf.d
342 + newins {,50-}nvidia-drm-outputclass.conf
343 +
344 + # vulkan icd uses libGLX_nvidia.so and so requires X
345 + insinto /usr/share/vulkan/icd.d
346 + doins nvidia_icd.json
347 + insinto /usr/share/vulkan/implicit_layer.d
348 + doins nvidia_layers.json
349 + fi
350 +
351 + insinto /usr/share/glvnd/egl_vendor.d
352 + doins 10_nvidia.json
353 +
354 + insinto /etc/OpenCL/vendors
355 + doins nvidia.icd
356 +
357 + insinto /etc/nvidia
358 + newins nvidia-application-profiles{-${PV},}-rc
359 +
360 + # install built helpers
361 + nvidia-drivers_make_install modprobe
362 + # allow video group to load mods and create devs (bug #505092)
363 + fowners :video /usr/bin/nvidia-modprobe
364 + fperms 4710 /usr/bin/nvidia-modprobe
365 +
366 + nvidia-drivers_make_install persistenced
367 + newconfd "${FILESDIR}/nvidia-persistenced.confd" nvidia-persistenced
368 + newinitd "${FILESDIR}/nvidia-persistenced.initd" nvidia-persistenced
369 + systemd_dounit nvidia-persistenced.service
370 +
371 + use X && nvidia-drivers_make_install xconfig
372 +
373 + if use tools; then
374 + nvidia-drivers_make_install settings
375 + doicon nvidia-settings/doc/nvidia-settings.png
376 + domenu nvidia-settings/doc/nvidia-settings.desktop
377 +
378 + insinto /usr/share/nvidia
379 + newins nvidia-application-profiles{-${PV},}-key-documentation
380 +
381 + exeinto /etc/X11/xinit/xinitrc.d
382 + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
383 + fi
384 +
385 + if use static-libs; then
386 + dolib.a nvidia-settings/src/out/libXNVCtrl.a
387 +
388 + insinto /usr/include/NVCtrl
389 + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h
390 + fi
391 +
392 + # install prebuilt-only helpers
393 + exeinto /opt/bin
394 +
395 + doexe nvidia-cuda-mps-control
396 + doman nvidia-cuda-mps-control.1
397 + doexe nvidia-cuda-mps-server
398 +
399 + doexe nvidia-debugdump
400 + dobin nvidia-bug-report.sh
401 +
402 + doexe nvidia-smi
403 + doman nvidia-smi.1
404 +
405 + # install prebuilt-only libraries
406 + multilib_foreach_abi nvidia-drivers_libs_install
407 +
408 + # install dlls for optional use with proton/wine
409 + insinto /usr/$(get_libdir)/nvidia/wine
410 + doins {_,}nvngx.dll
411 +
412 + # install systemd sleep services
413 + exeinto /lib/systemd/system-sleep
414 + doexe systemd/system-sleep/nvidia
415 + dobin systemd/nvidia-sleep.sh
416 + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
417 +
418 + # create README.gentoo
419 + local DISABLE_AUTOFORMATTING="yes"
420 + local DOC_CONTENTS=\
421 +"Trusted users should be in the 'video' group to use NVIDIA devices.
422 +You can add yourself by using: gpasswd -a my-user video
423 +
424 +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.
425 +
426 +For general information on using nvidia-drivers, please see:
427 +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
428 + readme.gentoo_create_doc
429 +
430 + einstalldocs
431 +}
432 +
433 +pkg_preinst() {
434 + use driver || return
435 + linux-mod_pkg_preinst
436 +
437 + # set video group id based on live system (bug #491414)
438 + local g=$(getent group video | cut -d: -f3)
439 + [[ ${g} ]] || die "Failed to determine video group id"
440 + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die
441 +
442 + # try to find driver mismatches using temporary supported-gpus.json
443 + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do
444 + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \
445 + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null)
446 + if [[ ${g} ]]; then
447 + g=$((${g##*\"}+1))
448 + if ver_test -ge ${g}; then
449 + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}"
450 + break
451 + fi
452 + fi
453 + done
454 + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die
455 +
456 + has_version "x11-drivers/nvidia-drivers[wayland]" && NV_HAD_WAYLAND=1
457 +}
458 +
459 +pkg_postinst() {
460 + use driver && linux-mod_pkg_postinst
461 +
462 + readme.gentoo_print_elog
463 +
464 + if [[ -r /proc/driver/nvidia/version &&
465 + $(grep -o ' [0-9.]* ' /proc/driver/nvidia/version) != " ${PV} " ]]; then
466 + ewarn "Currently loaded NVIDIA modules do not match the newly installed"
467 + ewarn "libraries and will lead to GPU-using application issues."
468 + use driver && ewarn "The easiest way to fix this is usually to reboot."
469 + fi
470 +
471 + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then
472 + ewarn "Detected that the current kernel command line is using 'slub_debug=',"
473 + ewarn "this may lead to system instability/freezes with this version of"
474 + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329"
475 + fi
476 +
477 + if [[ ${NV_LEGACY_MASK} ]]; then
478 + ewarn "***WARNING***"
479 + ewarn "You are installing a version of nvidia-drivers known not to work"
480 + ewarn "with a GPU of the current system. If unwanted, add the mask:"
481 + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then
482 + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}"
483 + else
484 + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask"
485 + fi
486 + ewarn "...then downgrade to a legacy branch if possible. For details, see:"
487 + ewarn "https://www.nvidia.com/object/IO_32667.html"
488 + fi
489 +
490 + if use wayland && use driver && [[ ! ${NV_HAD_WAYLAND} ]]; then
491 + elog
492 + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1"
493 + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered"
494 + elog "experimental but is required for EGLStream (used for wayland acceleration"
495 + elog "in compositors that support it)."
496 + elog
497 + elog "If you experience issues, please comment out the option from nvidia.conf."
498 + elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
499 + if has_version "gnome-base/gdm[wayland]"; then
500 + elog
501 + elog "This also cause gnome-base/gdm to use a wayland session by default,"
502 + elog "select 'GNOME on Xorg' if you wish to continue using it."
503 + fi
504 + fi
505 +
506 + # Try to show this message only to users that may really need it
507 + # given the workaround is discouraged and usage isn't widespread.
508 + if use X && [[ ${REPLACING_VERSIONS} ]] &&
509 + ver_test ${REPLACING_VERSIONS} -lt 460.73.01 &&
510 + grep -qr Coolbits "${EROOT}"/etc/X11/{xorg.conf,xorg.conf.d/*.conf} 2>/dev/null; then
511 + elog
512 + elog "Coolbits support with ${PN} has been restricted to require Xorg"
513 + elog "with root privilege by NVIDIA (being in video group is not sufficient)."
514 + elog "e.g. attempting to change fan speed with nvidia-settings would fail."
515 + elog
516 + elog "Depending on your display manager (e.g. sddm starts X as root, gdm doesn't)"
517 + elog "or if using startx, it may be necessary to emerge x11-base/xorg-server with"
518 + elog 'USE="suid -elogind -systemd" if wish to keep using this feature.'
519 + elog "Bug: https://bugs.gentoo.org/784248"
520 + fi
521 +}