diff options
Diffstat (limited to 'x11-drivers/nvidia-drivers')
-rw-r--r-- | x11-drivers/nvidia-drivers/Manifest | 2 | ||||
-rw-r--r-- | x11-drivers/nvidia-drivers/nvidia-drivers-530.41.03.ebuild | 154 |
2 files changed, 36 insertions, 120 deletions
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index 9d86694ced04..17291af8b139 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -58,5 +58,5 @@ EBUILD nvidia-drivers-470.182.03.ebuild 19546 BLAKE2B 660f4bfee27d996788ce3f3c41 EBUILD nvidia-drivers-515.105.01.ebuild 22131 BLAKE2B 93dfd835457666332c415c1381ea3e60e9fcc8fb531ee4b5141892d7746f1c94c81eba8a5c2f935cb426e85fb744b26249429c5056a34b4eab7b8baa03cbe14d SHA512 0846cd18ce209c546e60afea10c0eb531fa374e6f96790c961447a2f2cef1e59ba34413f9b43152845468cb71c753d43fb7023c64d98e6140c046258f00a8be9 EBUILD nvidia-drivers-525.116.04.ebuild 22009 BLAKE2B a7f72f66add739f7eed7ba9555924170a92504f4cbe93cdde698cb24f981d01f10c828671dcbff1b04cd8f9ae528e12b5bd31aa0eef743b1f69921cf11e59d18 SHA512 5d93236870330235c82f68dddd08aac43c0ae39d2cd24b7a938be7e65439a5efec66dd2e8851f47a1118339b287b12f106d7e990499f70c79cf5291b4bf23984 EBUILD nvidia-drivers-525.47.26.ebuild 22022 BLAKE2B c7b6f4341314c3005da5bdcc030cccc130e112e38d8e00e9f339c307b2ee0ca711c1d94dbfa3bea484b5a7ecfe6dac838f6c9ba284cbda71683ec2091de3fa50 SHA512 7218678d13af6b3cc09c1910fd17df85c8854a80631bd399bae31817a3db29fb2be024fb860884e32149d5c3efbd3a66e11b0cfa22b2f75f901bfda07de4a93c -EBUILD nvidia-drivers-530.41.03.ebuild 22012 BLAKE2B 6921dce0c79f38a2237c545f14440939ffb1a66a3ae40d6e12f92a8208ee94a8bd723245a15b40811299ab08b34748ae7ac426c93f62e66279a54716c55a3092 SHA512 3c2bc0a74357dca235e2771e4f8bee297bced12bf1efe32337d83138f46f57dc32a32e36b75ff5fc4e326de0b4d9a05bc4c7d2c05cc668c842e2d0bb59dccd0c +EBUILD nvidia-drivers-530.41.03.ebuild 18951 BLAKE2B c391da3af1313812cebba4f9499bf62b5cfe08fac92fc6bafbc15138f90a0109dd428afe72722d1a20bc735d1d0b54fd9d7a16705e442d876d72761eca6eb5aa SHA512 4573001535b147057a86de4ea6d9187d2a1b256631e6c5073607cd1368679efb32c40f616702ba45a9d384852e401ee58d2a0067317073abd7562fc5cee19437 MISC metadata.xml 1340 BLAKE2B 8afeddcb3cb7ab0f83ecc0141cee9e3d8729baf5ce559d15a305c3efdeb4b172fbf86607aa5c8f546aaf7a704d837f13afffce615d3bc831bee63d77e0580afb SHA512 26fbfc0164ce57126d75f112859d91d21f17a5a9a48c7ab4d8bb9d7c8c63ce9fab9304f2992e61050dcae5e01836d4cb9b0384e680fe51ee5322efe39bc5693b diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-530.41.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-530.41.03.ebuild index c8d2595c17a3..5b33f3b5beb5 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-530.41.03.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-530.41.03.ebuild @@ -3,11 +3,11 @@ EAPI=8 -MODULES_OPTIONAL_USE="driver" -inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \ - systemd toolchain-funcs unpacker user-info +MODULES_OPTIONAL_IUSE="+modules" +inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info -NV_KERNEL_MAX="6.3" +MODULES_KERNEL_MAX=6.3 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -24,8 +24,8 @@ S="${WORKDIR}" LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" SLOT="0/${PV%%.*}" KEYWORDS="-* ~amd64 ~arm64" -IUSE="+X abi_x86_32 abi_x86_64 +driver kernel-open persistenced +static-libs +tools wayland" -REQUIRED_USE="kernel-open? ( driver )" +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 @@ -88,7 +88,7 @@ PATCHES=( ) pkg_setup() { - use driver || return + use modules && [[ ${MERGE_TYPE} != binary ]] || return local CONFIG_CHECK=" PROC_FS @@ -114,18 +114,7 @@ pkg_setup() { Cannot be directly selected in the kernel's menuconfig, and may need selection of another option that requires it such as CONFIG_KVM." - MODULE_NAMES=" - nvidia(video:kernel) - nvidia-drm(video:kernel) - nvidia-modeset(video:kernel) - nvidia-peermem(video:kernel) - nvidia-uvm(video:kernel)" - use kernel-open && - MODULE_NAMES=${MODULE_NAMES//:kernel/:kernel-module-source:kernel-module-source/kernel-open} - - linux-mod_pkg_setup - - [[ ${MERGE_TYPE} == binary ]] && return + 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 @@ -189,77 +178,6 @@ pkg_setup() { (( ${#warn[@]} )) && ewarn "Detected potential configuration issues with used kernel:${warn[*]/#/$'\n'}" - - BUILD_PARAMS='NV_VERBOSE=1 IGNORE_CC_MISMATCH=yes SYSSRC="${KV_DIR}" SYSOUT="${KV_OUT_DIR}"' - BUILD_TARGETS="modules" - - # Try to match toolchain with kernel only for modules - # (experimental, ideally this should be handled in linux-mod.eclass) - nvidia-tc-set() { - local -n var=KERNEL_${1} - if [[ ! -v var ]]; then - read -r var < <(type -P "${@:2}") || - die "failed to find in PATH at least one of: ${*:2}" - einfo "Forcing '${var}' for modules (set ${!var} to override)" - fi - } - - local tool switch - if linux_chkconfig_present CC_IS_GCC; then - if ! tc-is-gcc; then - switch= - nvidia-tc-set CC {${CHOST}-,}gcc - nvidia-tc-set CXX {${CHOST}-,}g++ # needed by kernel-open - fi - elif linux_chkconfig_present CC_IS_CLANG; then - ewarn "Warning: using ${PN} with a clang-built kernel is largely untested" - if ! tc-is-clang; then - switch=llvm- - nvidia-tc-set CC {${CHOST}-,}clang - nvidia-tc-set CXX {${CHOST}-,}clang++ - fi - fi - - if linux_chkconfig_present LD_IS_BFD; then - # tc-ld-is-bfd needs https://github.com/gentoo/gentoo/pull/28355 - [[ $(LC_ALL=C $(tc-getLD) --version 2>/dev/null) == "GNU ld"* ]] || - nvidia-tc-set LD {${CHOST}-,}{ld.bfd,ld} - elif linux_chkconfig_present LD_IS_LLD; then - tc-ld-is-lld || nvidia-tc-set LD {${CHOST}-,}{ld.lld,lld} - fi - - if [[ -v switch ]]; then - # only need llvm-nm for lto, but use complete set to be safe - for tool in AR NM OBJCOPY OBJDUMP READELF STRIP; do - case $(LC_ALL=C $(tc-get${tool}) --version 2>/dev/null) in - LLVM*|llvm*) [[ ! ${switch} ]];; - *) [[ ${switch} ]];; - esac && nvidia-tc-set ${tool} {${CHOST}-,}${switch}${tool,,} - done - fi - - # pass unconditionally given exports are semi-ignored except CC/LD - for tool in CC CXX LD AR NM OBJCOPY OBJDUMP READELF STRIP; do - BUILD_PARAMS+=" ${tool}=\"\${KERNEL_${tool}:-\$(tc-get${tool})}\"" - done - - if linux_chkconfig_present LTO_CLANG_THIN; then - # kernel enables cache by default leading to sandbox violations - BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir=' - fi - - if kernel_is -gt ${NV_KERNEL_MAX/./ }; then - ewarn "Kernel ${KV_MAJOR}.${KV_MINOR} is either known to break this version of ${PN}" - ewarn "or was not tested with it. It is recommended to use one of:" - ewarn " <=sys-kernel/gentoo-kernel-${NV_KERNEL_MAX}.x" - ewarn " <=sys-kernel/gentoo-sources-${NV_KERNEL_MAX}.x" - ewarn "You are free to try or use /etc/portage/patches, but support will" - ewarn "not be given and issues wait until NVIDIA releases a fixed version" - ewarn "(Gentoo will not accept patches for this)." - ewarn - ewarn "Do _not_ file a bug report if run into issues." - ewarn - fi } src_prepare() { @@ -317,30 +235,29 @@ src_compile() { XNVCTRL_CFLAGS="${xnvflags}" ) - if use driver; then - if linux_chkconfig_present GCC_PLUGINS; then - mkdir "${T}"/plugin-test || die - echo "obj-m += test.o" > "${T}"/plugin-test/Kbuild || die - :> "${T}"/plugin-test/test.c || die - if [[ $(LC_ALL=C make -C "${KV_OUT_DIR}" ARCH="$(tc-arch-kernel)" \ - HOSTCC="$(tc-getBUILD_CC)" CC="${CC}" M="${T}"/plugin-test 2>&1) \ - =~ "error: incompatible gcc/plugin version" ]] - then - eerror "Detected kernel was built with a different gcc/plugin version," - eerror "Please 'make clean' and rebuild your kernel with the current" - eerror "gcc (or re-emerge for distribution kernels, including kernel-bin)." - die "kernel ${KV_FULL} needs to be rebuilt" - fi - fi - + if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + # TODO?: may make sense to switch to one of kernel/drivers/video:, + # nvidia: or use the default (aka extra) -- first is most correct but + # users may prefer these easier to find and not mixed with kernel's + local modlistargs=video:kernel if use kernel-open; then - # building the nvidia "blob" fails with lto, and also need - # to strip in case of a different toolchain for the kernel + 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 - strip-unsupported-flags + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags fi - linux-mod_src_compile + + 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 @@ -393,7 +310,7 @@ src_install() { ) local skip_modules=( $(usev !X "nvfbc vdpau xdriver") - $(usev !driver gsp) + $(usev !modules gsp) installer nvpd # handled separately / built from source ) local skip_types=( @@ -413,7 +330,7 @@ src_install() { 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 driver " +$(usev modules " Like all out-of-tree kernel modules, it is necessary to rebuild ${PN} after upgrading or rebuilding the Linux kernel @@ -437,8 +354,8 @@ For general information on using ${PN}, please see: https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" readme.gentoo_create_doc - if use driver; then - linux-mod_src_install + if use modules; then + linux-mod-r1_src_install insinto /etc/modprobe.d doins "${T}"/nvidia.conf @@ -553,8 +470,7 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers" pkg_preinst() { has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= - use driver || return - linux-mod_pkg_preinst + use modules || return # set video group id based on live system (bug #491414) local g=$(egetent group video | cut -d: -f3) @@ -577,7 +493,7 @@ pkg_preinst() { } pkg_postinst() { - linux-mod_pkg_postinst + linux-mod-r1_pkg_postinst readme.gentoo_print_elog @@ -585,7 +501,7 @@ pkg_postinst() { $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." - use driver && ewarn "The easiest way to fix this is usually to reboot." + use modules && ewarn "The easiest way to fix this is usually to reboot." fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then @@ -622,7 +538,7 @@ pkg_postinst() { ewarn "Switch back to USE=-kernel-open to restore functionality if needed for now." fi - if use wayland && use driver && [[ ! -v NV_HAD_WAYLAND ]]; then + 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" |