From 67dbd3ba144944fbf4b466be1b5fa0569b774e6f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Feb 2025 19:25:33 +0000 Subject: gentoo auto-resync : 25:02:2025 - 19:25:33 --- dev-util/nvidia-cuda-toolkit/Manifest | 4 +- .../files/nvidia-cuda-toolkit-glibc-2.41-r1.patch | 72 ++++ .../files/nvidia-cuda-toolkit-glibc-2.41.patch | 72 ---- .../nvidia-cuda-toolkit-12.8.0-r1.ebuild | 372 --------------------- .../nvidia-cuda-toolkit-12.8.0-r2.ebuild | 372 +++++++++++++++++++++ 5 files changed, 446 insertions(+), 446 deletions(-) create mode 100644 dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41-r1.patch delete mode 100644 dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41.patch delete mode 100644 dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r1.ebuild create mode 100644 dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r2.ebuild (limited to 'dev-util/nvidia-cuda-toolkit') diff --git a/dev-util/nvidia-cuda-toolkit/Manifest b/dev-util/nvidia-cuda-toolkit/Manifest index 2f16874475f2..709e6f9ee2c8 100644 --- a/dev-util/nvidia-cuda-toolkit/Manifest +++ b/dev-util/nvidia-cuda-toolkit/Manifest @@ -1,5 +1,5 @@ AUX cuda-config.in 407 BLAKE2B 5f7a0d50d774db58c180b767f00bead7c7dbf5f6b3b4a2f960dfc3b8450f7abf5c2b67c6620c5318f1331646dd2003d61c70a4c31359efd16ff418ecc9d0b446 SHA512 363903b999c43a47a48c52e8898c6044fadcc66d259338ee22863e859c2bc9873a2f1392aa83c9182486d3aa4eaeb5f164cf8ccf29cc74fd8ad56245f76a039a -AUX nvidia-cuda-toolkit-glibc-2.41.patch 3067 BLAKE2B 66482f56a1797116f9c8cb6014265c9dbc1fd4032ca2b68e59eca1a4ba45b3b86bc3aca8869752ee0d52392305196efa679258399a252b145ce5c53c9e35804b SHA512 58acf6c195fe85e4e25bb17af3b03acfe6c5dfe1111f5705f39a6a3ef3ff4621f59bece49d1dbbdd4f81948c1c2d707d2948ae9148e328c09e517f809fd503cb +AUX nvidia-cuda-toolkit-glibc-2.41-r1.patch 3163 BLAKE2B a3d5dbc50898b1502a342c3c70997864bc0e49ccf035b32a76a4ca1b282d236609b5ebc5d094ac0489abcb835456231a90428a758471af59464198b0dcf79999 SHA512 e0fb0018273416df4c1c40e5f74f6d0261a93bb9c4471c12732306b40903c1df8a509a9fd9060d968ac5484b791b6dd86a6db80b6993b979b22a41f44d6bf456 AUX parse_manifest.py 8488 BLAKE2B fe4748e41727e717d99b3b7f294d7c8e67b44e3f352f27a76c386502870e6134217ead3d93714755f50b0393d514b9e317748aed89637c660e354d53354d1485 SHA512 ab90e614bfd729a0a90a7373d58fcf2f6e7ba3beb8a00841b87e8240c9386a678daf551f4fcc89040f10d46d159e316442978c60b1a8960070576cfb7a11d52c DIST cuda_11.8.0_520.61.05_linux.run 4336730777 BLAKE2B cfdb4a51c49ee504e56a4a95de4e477ef207b678527cbb633c1e83e667f1a62c0f67038befd0b10f7ae24cda9c8bc5c54293d06a05b2e45be6cf677e40f71f17 SHA512 e96e1389abed34b5093b3a1d4e6ae9f3d4f8406621b1475f378efae65868657efce22da03b5b4e0a548d9635e406b8690b18b17b186d03ecb3ca0703c5d5787a DIST cuda_12.3.2_545.23.08_linux.run 4368514070 BLAKE2B bfb6239b7669636e2ef424921f5a1dd99409a0351ea7d3453fcec3d484e714d87639e733cfae913b0f222d7af8acb7bebae340ea8af53fb7ab320805abb7b230 SHA512 dce569e42955fc351a6b52b2876948029d5183bb000754f0cdcba754673a280acfd4c9e4d8cf61d572ed045de006e0bbb0e8ff32012e6cc336be9c05fd529340 @@ -19,5 +19,5 @@ EBUILD nvidia-cuda-toolkit-12.5.0-r1.ebuild 9535 BLAKE2B b8b50bede8a66a8bce76f66 EBUILD nvidia-cuda-toolkit-12.5.1.ebuild 9535 BLAKE2B ea6b46070159a18d8f541af47d648a79b75f7f964d689418220e4eaf87c56fc000eb39fed84637c161aa5f18e5f7e03f0615cbec6670517fd2efefd83139a0a4 SHA512 47bca7b76aad3842f37d8da4fbbdf646a1ca2cc93bc7ae870d8e164a05f735974ca28d69a99a6d0ffcd331e5134025b3819360f27c65dc6c27338756bfc74ba8 EBUILD nvidia-cuda-toolkit-12.6.0.ebuild 9535 BLAKE2B 984ec77cc39675ba22703339ecbd5596452a5631c7303e4db492bad0b80496ea13151cb25f87a7c0e39d9d2a173be7ad9469a91acfd785abb83632caae230297 SHA512 efbf2fcc39f60ca1f35f15202e924146618b4441c090d26e07048e10dee6ddd79f10640b1c6d8d2e84a218edb6a1382f2398eaf182a503d5dd6dbce250844af3 EBUILD nvidia-cuda-toolkit-12.6.1-r1.ebuild 9685 BLAKE2B dbbfe46f57fc1a42a91d8a5b1e72651adb9d204abb05512945dd9af691872f4285c69918918a131adcfb749e7832c31bf8738321f8909a4656824c2727e899d2 SHA512 519dcf9c06f7a11a6405dac69b003e6b37d1d32007f3231038d3254c9901815a25cbdceb3401adfb783be77c683ce53acd76ea3722bb4b2c66d5e9265399967c -EBUILD nvidia-cuda-toolkit-12.8.0-r1.ebuild 10528 BLAKE2B b754068e51f8a7044ede690f57c347b8190869875356d3e3dcf3872e201b111a205337a472a703a37a947733cb00a44ab82757fe973d1a303eb9ab781ad4b8ae SHA512 25b93fc768aee3e56594bcb157f7f4390b21cac759cb31ed41fff60d824d188819b01e5b384cd54b5101afdbd96f68feebf5baec57b947dee4b1d256ce09987f +EBUILD nvidia-cuda-toolkit-12.8.0-r2.ebuild 10531 BLAKE2B e348807f8ed3e64e17f94c5f099e1fe07c69af2a05e29cfd70a99b2dd0983c01869be38d848a94754226dc0fde3ad72ccd1b3d4a9ebd2bd3940ad48acaeecd20 SHA512 33fc3c60e95cc377557f4617a7879cfaf057e9632886b00d0896a8e89eda822cfb252b967e6f2d03eacb16774d607c8e2676846b7ed055d2e6f86ec63136e54c MISC metadata.xml 761 BLAKE2B a6ae653c6206cbc05349297499b6dde91bce6d543e10bd5ea915cfe9729dfa6f1eb954ae09c2e4d3997f51315ae090b38606c21b5099e750596ea66fdd93e817 SHA512 9133517d805201d25b651e48abed90394c88ef33a2571ab20b3b19d365f85a90478486c7c087c9150d7d9f6e4026873c5236c64ed649fd3bfc8f9b81479dcc59 diff --git a/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41-r1.patch b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41-r1.patch new file mode 100644 index 000000000000..315630273db6 --- /dev/null +++ b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41-r1.patch @@ -0,0 +1,72 @@ +From cae8ab12c9f981f110bb2e1318d9c5306e3a2d81 Mon Sep 17 00:00:00 2001 +From: Paul Zander +Date: Sat, 8 Feb 2025 16:34:42 +0100 +Subject: [PATCH] Updates headers for glibc-2.41 + +Match the extern definitions in cuda-crt headers with the changes in glibc-2.41. + +/usr/include/bits/mathcalls.h(79): error: exception specification is +incompatible with that of previous function "cospi" (declared at line 2601 +of +/opt/cuda-12.8.0/bin/../targets/x86_64-linux/include/crt/math_functions.h) + + extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true); + +See-Also: https://sourceware.org/git/?p=glibc.git;a=commit;h=0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3 +Signed-off-by: Paul Zander + +diff --git a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h +index d8201f9..a9b19d4 100644 +--- a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h ++++ b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h +@@ -2553,7 +2553,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rcbrt + * + * \note_accuracy_double + */ ++#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41 ++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true); ++#else + extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x); ++#endif + /** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the sine of the input argument +@@ -2576,7 +2580,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi + * + * \note_accuracy_single + */ ++#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41 ++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true); ++#else + extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x); ++#endif + /** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the cosine of the input argument +@@ -2598,7 +2606,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpi + * + * \note_accuracy_double + */ ++#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41 ++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x) noexcept (true); ++#else + extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x); ++#endif + /** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the cosine of the input argument +@@ -2620,7 +2632,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi + * + * \note_accuracy_single + */ ++#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ >= 41 ++extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x) noexcept (true); ++#else + extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x); ++#endif + /** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the sine and cosine of the first input argument +-- +2.48.1 + diff --git a/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41.patch b/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41.patch deleted file mode 100644 index c8d43014d30a..000000000000 --- a/dev-util/nvidia-cuda-toolkit/files/nvidia-cuda-toolkit-glibc-2.41.patch +++ /dev/null @@ -1,72 +0,0 @@ -From cae8ab12c9f981f110bb2e1318d9c5306e3a2d81 Mon Sep 17 00:00:00 2001 -From: Paul Zander -Date: Sat, 8 Feb 2025 16:34:42 +0100 -Subject: [PATCH] Updates headers for glibc-2.41 - -Match the extern definitions in cuda-crt headers with the changes in glibc-2.41. - -/usr/include/bits/mathcalls.h(79): error: exception specification is -incompatible with that of previous function "cospi" (declared at line 2601 -of -/opt/cuda-12.8.0/bin/../targets/x86_64-linux/include/crt/math_functions.h) - - extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true); - -See-Also: https://sourceware.org/git/?p=glibc.git;a=commit;h=0ae0af68d8fa3bf6cbe1e4f1de5929ff71de67b3 -Signed-off-by: Paul Zander - -diff --git a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h -index d8201f9..a9b19d4 100644 ---- a/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h -+++ b/builds/cuda_nvcc/targets/x86_64-linux/include/crt/math_functions.h -@@ -2553,7 +2553,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rcbrt - * - * \note_accuracy_double - */ -+#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) -+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true); -+#else - extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x); -+#endif - /** - * \ingroup CUDA_MATH_SINGLE - * \brief Calculate the sine of the input argument -@@ -2576,7 +2580,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi - * - * \note_accuracy_single - */ -+#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) -+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true); -+#else - extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x); -+#endif - /** - * \ingroup CUDA_MATH_DOUBLE - * \brief Calculate the cosine of the input argument -@@ -2598,7 +2606,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpi - * - * \note_accuracy_double - */ -+#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) -+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x) noexcept (true); -+#else - extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x); -+#endif - /** - * \ingroup CUDA_MATH_SINGLE - * \brief Calculate the cosine of the input argument -@@ -2620,7 +2632,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi - * - * \note_accuracy_single - */ -+#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) -+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x) noexcept (true); -+#else - extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x); -+#endif - /** - * \ingroup CUDA_MATH_DOUBLE - * \brief Calculate the sine and cosine of the first input argument --- -2.48.1 - diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r1.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r1.ebuild deleted file mode 100644 index f4e593b9052d..000000000000 --- a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r1.ebuild +++ /dev/null @@ -1,372 +0,0 @@ -# Copyright 1999-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# shellcheck disable=SC2317 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..13} ) -inherit check-reqs toolchain-funcs -inherit python-r1 - -DRIVER_PV="570.86.10" -GCC_MAX_VER="14" -CLANG_MAX_VER="19" - -DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)" -HOMEPAGE="https://developer.nvidia.com/cuda-zone" -SRC_URI=" - amd64? ( - https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux.run - ) - arm64? ( - https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux_sbsa.run - ) -" -S="${WORKDIR}" - -LICENSE="NVIDIA-CUDA" - -SLOT="0/${PV}" # UNSLOTTED -# SLOT="${PV}" # SLOTTED - -KEYWORDS="-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux" -IUSE="debugger examples profiler rdma sanitizer" -RESTRICT="bindist mirror strip test" - -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -# since CUDA 11, the bundled toolkit driver (== ${DRIVER_PV}) and the -# actual required minimum driver version are different. -RDEPEND=" - || ( - ${ED} ${_DESTDIR}" - } - - dopcfile() { - [[ $# -eq 0 ]] && return - - dodir "${CUDA_PATH}/pkgconfig" - cat > "${ED}${CUDA_PATH}/pkgconfig/${1}-${2}.pc" <<-EOF || die "dopcfile" - cudaroot=${EPREFIX}${CUDA_PATH} - libdir=\${cudaroot}/targets/${narch}-linux/lib${4} - includedir=\${cudaroot}/targets/${narch}-linux/include - - Name: ${1} - Description: ${3} - Version: ${2} - Libs: -L\${libdir} -l${1} - Cflags: -I\${includedir} - EOF - } - - pushd builds >/dev/null || die - fix_executable_bit=( - cuda_cupti/extras/CUPTI/samples/pc_sampling_utility/pc_sampling_utility_helper.h - cuda_cupti/extras/CUPTI/samples/pc_sampling_continuous/libpc_sampling_continuous.pl - - libcufile/gds/tools/run_gdsio.cfg - ) - - if use amd64; then - fix_executable_bit+=( - cuda_opencl/targets/*/include/CL/cl.hpp - - libcufile/targets/*/lib/libcufile_rdma_static.a - libcufile/targets/*/lib/libcufile_static.a - ) - fi - chmod -x "${fix_executable_bit[@]}" || die "failed chmod" - popd >/dev/null || die - - ebegin "parsing manifest" "${S}/manifests/cuda_"*.xml # {{{ - - "${EPYTHON}" "${FILESDIR}/parse_manifest.py" "${S}/manifests/cuda_"*".xml" &> "${T}/install.sh" \ - || die "failed to parse manifest" - # shellcheck disable=SC1091 - source "${T}/install.sh" || die "failed to source install script" - - eend $? # }}} - - if use debugger; then - if [[ -d "${ED}/${CUDA_PATH}/extras/Debugger/lib64" ]]; then - rmdir "${ED}/${CUDA_PATH}/extras/Debugger/lib64" || die "remove debugger lib64" - fi - - find "${ED}/${CUDA_PATH}/bin" -maxdepth 1 -name "cuda-gdb-*-tui" -print0 | while read -rd $'\0' tui_name; do - impl="$(basename "${tui_name}" | cut -d '-' -f 3 | tr '.' '_')" - - if ! has "${impl}" "${PYTHON_COMPAT[@]}" || ! use "python_targets_${impl}"; then - rm "${tui_name}" || die "tui-name rm ${tui_name}" - sed -e "/$(basename "${tui_name}")\"/d" -i "${ED}/${CUDA_PATH}/bin/cuda-gdb" || die "tui_name sed" - fi - done - fi - - # remove rdma libs (unless USE=rdma) - if ! use rdma; then - rm "${ED}/${CUDA_PATH}/targets/${narch}-linux/lib/libcufile_rdma"* || die "failed to remove rdma files" - fi - - # Add include and lib symlinks - dosym "targets/${narch}-linux/include" "${CUDA_PATH}/include" - dosym "targets/${narch}-linux/lib" "${CUDA_PATH}/lib64" - - find "${ED}/${CUDA_PATH}" -empty -delete || die - - local ldpathextradirs pathextradirs - - use debugger && ldpathextradirs+=":${EPREFIX}${CUDA_PATH}/extras/Debugger/lib64" - use profiler && ldpathextradirs+=":${EPREFIX}${CUDA_PATH}/extras/CUPTI/lib64" - - local revord=$(( 999999 - $(printf "%02d%02d%02d" "$(ver_cut 1)" "$(ver_cut 2)" "$(ver_cut 3)") )) - newenvd - "99cuda${revord}" <<-EOF - PATH=${EPREFIX}${CUDA_PATH}/bin${pathextradirs} - PKG_CONFIG_PATH=${EPREFIX}${CUDA_PATH}/pkgconfig - LDPATH=${EPREFIX}${CUDA_PATH}/lib64:${EPREFIX}${CUDA_PATH}/nvvm/lib64${ldpathextradirs} - EOF - - # CUDA prepackages libraries, don't revdep-build on them - insinto /etc/revdep-rebuild - newins - "80${PN}${revord}" <<-EOF - SEARCH_DIRS_MASK="${EPREFIX}${CUDA_PATH}" - EOF - - # https://bugs.gentoo.org/926116 - insinto /etc/sandbox.d - newins - "80${PN}" <<-EOF - SANDBOX_PREDICT="/proc/self/task" - EOF - - # TODO drop and replace with runtime detection similar to what python does {{{ - # ATTENTION: change requires revbump, see link below for supported GCC # versions - # https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements - local cuda_supported_gcc=( 8.5 9.5 10 11 12 13 "${GCC_MAX_VER}" ) - - sed \ - -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc[*]}:g" \ - "${FILESDIR}"/cuda-config.in > "${ED}/${CUDA_PATH}/bin/cuda-config" || die - fperms +x "${CUDA_PATH}/bin/cuda-config" - # }}} - - # skip til cudnn has been changed #950207 - # if [[ "${SLOT}" != "${PV}" ]]; then - # dosym "${CUDA_PATH}" "${CUDA_PATH%"-${PV}"}" - # fi - - fowners -R root:root "${CUDA_PATH}" -} - -pkg_postinst_check() { - if tc-is-gcc && - ver_test "$(gcc-major-version)" -gt "${GCC_MAX_VER}"; then - ewarn - ewarn "gcc > ${GCC_MAX_VER} will not work with CUDA" - ewarn - ewarn "Append --ccbin= pointing to a gcc bindir to the nvcc compiler flags (NVCCFLAGS)" - ewarn "or set NVCC_CCBIN to the same bindir." - ewarn " NVCCFLAGS=\"--ccbin=$(eval echo "${EPREFIX}/usr/*-linux-gnu/gcc-bin/${GCC_MAX_VER}")\"" - ewarn " NVCC_CCBIN=$(eval echo "${EPREFIX}/usr/*-linux-gnu/gcc-bin/${GCC_MAX_VER}")" - ewarn - fi - - if tc-is-clang && - ver_test "$(clang-major-version)" -gt "${CLANG_MAX_VER}"; then - ewarn - ewarn "clang > ${CLANG_MAX_VER} will not work with CUDA" - ewarn - ewarn "Append --ccbin= pointing to a clang bindir to the nvcc compiler flags (NVCCFLAGS)" - ewarn "or set NVCC_CCBIN to the same bindir." - ewarn " NVCCFLAGS=\"--ccbin=$(eval echo "${EPREFIX}/usr/lib/llvm/*/bin${CLANG_MAX_VER}")\"" - ewarn " NVCC_CCBIN=$(eval echo "${EPREFIX}/usr/lib/llvm/*/bin${CLANG_MAX_VER}")" - ewarn - fi -} - -pkg_postinst() { - if [[ ${MERGE_TYPE} != binary ]]; then - pkg_postinst_check - fi - - if use profiler; then - einfo - einfo "nvidia-drivers restricts access to performance counters." - einfo "You'll need to run profiling tools (nvprof) " - einfo "using sudo (needs cap SYS_ADMIN) or add the following line to " - einfo "a modprobe configuration file " - einfo "(e.g. /etc/modprobe.d/nvidia-prof.conf): " - einfo - einfo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" - einfo - fi -} diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r2.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r2.ebuild new file mode 100644 index 000000000000..687c48f30537 --- /dev/null +++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-12.8.0-r2.ebuild @@ -0,0 +1,372 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# shellcheck disable=SC2317 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) +inherit check-reqs toolchain-funcs +inherit python-r1 + +DRIVER_PV="570.86.10" +GCC_MAX_VER="14" +CLANG_MAX_VER="19" + +DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)" +HOMEPAGE="https://developer.nvidia.com/cuda-zone" +SRC_URI=" + amd64? ( + https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux.run + ) + arm64? ( + https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux_sbsa.run + ) +" +S="${WORKDIR}" + +LICENSE="NVIDIA-CUDA" + +SLOT="0/${PV}" # UNSLOTTED +# SLOT="${PV}" # SLOTTED + +KEYWORDS="-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux" +IUSE="debugger examples profiler rdma sanitizer" +RESTRICT="bindist mirror strip test" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# since CUDA 11, the bundled toolkit driver (== ${DRIVER_PV}) and the +# actual required minimum driver version are different. +RDEPEND=" + || ( + ${ED} ${_DESTDIR}" + } + + dopcfile() { + [[ $# -eq 0 ]] && return + + dodir "${CUDA_PATH}/pkgconfig" + cat > "${ED}${CUDA_PATH}/pkgconfig/${1}-${2}.pc" <<-EOF || die "dopcfile" + cudaroot=${EPREFIX}${CUDA_PATH} + libdir=\${cudaroot}/targets/${narch}-linux/lib${4} + includedir=\${cudaroot}/targets/${narch}-linux/include + + Name: ${1} + Description: ${3} + Version: ${2} + Libs: -L\${libdir} -l${1} + Cflags: -I\${includedir} + EOF + } + + pushd builds >/dev/null || die + fix_executable_bit=( + cuda_cupti/extras/CUPTI/samples/pc_sampling_utility/pc_sampling_utility_helper.h + cuda_cupti/extras/CUPTI/samples/pc_sampling_continuous/libpc_sampling_continuous.pl + + libcufile/gds/tools/run_gdsio.cfg + ) + + if use amd64; then + fix_executable_bit+=( + cuda_opencl/targets/*/include/CL/cl.hpp + + libcufile/targets/*/lib/libcufile_rdma_static.a + libcufile/targets/*/lib/libcufile_static.a + ) + fi + chmod -x "${fix_executable_bit[@]}" || die "failed chmod" + popd >/dev/null || die + + ebegin "parsing manifest" "${S}/manifests/cuda_"*.xml # {{{ + + "${EPYTHON}" "${FILESDIR}/parse_manifest.py" "${S}/manifests/cuda_"*".xml" &> "${T}/install.sh" \ + || die "failed to parse manifest" + # shellcheck disable=SC1091 + source "${T}/install.sh" || die "failed to source install script" + + eend $? # }}} + + if use debugger; then + if [[ -d "${ED}/${CUDA_PATH}/extras/Debugger/lib64" ]]; then + rmdir "${ED}/${CUDA_PATH}/extras/Debugger/lib64" || die "remove debugger lib64" + fi + + find "${ED}/${CUDA_PATH}/bin" -maxdepth 1 -name "cuda-gdb-*-tui" -print0 | while read -rd $'\0' tui_name; do + impl="$(basename "${tui_name}" | cut -d '-' -f 3 | tr '.' '_')" + + if ! has "${impl}" "${PYTHON_COMPAT[@]}" || ! use "python_targets_${impl}"; then + rm "${tui_name}" || die "tui-name rm ${tui_name}" + sed -e "/$(basename "${tui_name}")\"/d" -i "${ED}/${CUDA_PATH}/bin/cuda-gdb" || die "tui_name sed" + fi + done + fi + + # remove rdma libs (unless USE=rdma) + if ! use rdma; then + rm "${ED}/${CUDA_PATH}/targets/${narch}-linux/lib/libcufile_rdma"* || die "failed to remove rdma files" + fi + + # Add include and lib symlinks + dosym "targets/${narch}-linux/include" "${CUDA_PATH}/include" + dosym "targets/${narch}-linux/lib" "${CUDA_PATH}/lib64" + + find "${ED}/${CUDA_PATH}" -empty -delete || die + + local ldpathextradirs pathextradirs + + use debugger && ldpathextradirs+=":${EPREFIX}${CUDA_PATH}/extras/Debugger/lib64" + use profiler && ldpathextradirs+=":${EPREFIX}${CUDA_PATH}/extras/CUPTI/lib64" + + local revord=$(( 999999 - $(printf "%02d%02d%02d" "$(ver_cut 1)" "$(ver_cut 2)" "$(ver_cut 3)") )) + newenvd - "99cuda${revord}" <<-EOF + PATH=${EPREFIX}${CUDA_PATH}/bin${pathextradirs} + PKG_CONFIG_PATH=${EPREFIX}${CUDA_PATH}/pkgconfig + LDPATH=${EPREFIX}${CUDA_PATH}/lib64:${EPREFIX}${CUDA_PATH}/nvvm/lib64${ldpathextradirs} + EOF + + # CUDA prepackages libraries, don't revdep-build on them + insinto /etc/revdep-rebuild + newins - "80${PN}${revord}" <<-EOF + SEARCH_DIRS_MASK="${EPREFIX}${CUDA_PATH}" + EOF + + # https://bugs.gentoo.org/926116 + insinto /etc/sandbox.d + newins - "80${PN}" <<-EOF + SANDBOX_PREDICT="/proc/self/task" + EOF + + # TODO drop and replace with runtime detection similar to what python does {{{ + # ATTENTION: change requires revbump, see link below for supported GCC # versions + # https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements + local cuda_supported_gcc=( 8.5 9.5 10 11 12 13 "${GCC_MAX_VER}" ) + + sed \ + -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc[*]}:g" \ + "${FILESDIR}"/cuda-config.in > "${ED}/${CUDA_PATH}/bin/cuda-config" || die + fperms +x "${CUDA_PATH}/bin/cuda-config" + # }}} + + # skip til cudnn has been changed #950207 + # if [[ "${SLOT}" != "${PV}" ]]; then + # dosym "${CUDA_PATH}" "${CUDA_PATH%"-${PV}"}" + # fi + + fowners -R root:root "${CUDA_PATH}" +} + +pkg_postinst_check() { + if tc-is-gcc && + ver_test "$(gcc-major-version)" -gt "${GCC_MAX_VER}"; then + ewarn + ewarn "gcc > ${GCC_MAX_VER} will not work with CUDA" + ewarn + ewarn "Append --ccbin= pointing to a gcc bindir to the nvcc compiler flags (NVCCFLAGS)" + ewarn "or set NVCC_CCBIN to the same bindir." + ewarn " NVCCFLAGS=\"--ccbin=$(eval echo "${EPREFIX}/usr/*-linux-gnu/gcc-bin/${GCC_MAX_VER}")\"" + ewarn " NVCC_CCBIN=$(eval echo "${EPREFIX}/usr/*-linux-gnu/gcc-bin/${GCC_MAX_VER}")" + ewarn + fi + + if tc-is-clang && + ver_test "$(clang-major-version)" -gt "${CLANG_MAX_VER}"; then + ewarn + ewarn "clang > ${CLANG_MAX_VER} will not work with CUDA" + ewarn + ewarn "Append --ccbin= pointing to a clang bindir to the nvcc compiler flags (NVCCFLAGS)" + ewarn "or set NVCC_CCBIN to the same bindir." + ewarn " NVCCFLAGS=\"--ccbin=$(eval echo "${EPREFIX}/usr/lib/llvm/*/bin${CLANG_MAX_VER}")\"" + ewarn " NVCC_CCBIN=$(eval echo "${EPREFIX}/usr/lib/llvm/*/bin${CLANG_MAX_VER}")" + ewarn + fi +} + +pkg_postinst() { + if [[ ${MERGE_TYPE} != binary ]]; then + pkg_postinst_check + fi + + if use profiler; then + einfo + einfo "nvidia-drivers restricts access to performance counters." + einfo "You'll need to run profiling tools (nvprof) " + einfo "using sudo (needs cap SYS_ADMIN) or add the following line to " + einfo "a modprobe configuration file " + einfo "(e.g. /etc/modprobe.d/nvidia-prof.conf): " + einfo + einfo "options nvidia NVreg_RestrictProfilingToAdminUsers=0" + einfo + fi +} -- cgit v1.2.3