Update nvidia-cuda-toolkit to 13.3.0

This commit is contained in:
Mario Fetka
2026-06-29 19:07:40 +02:00
parent d4cde4b057
commit 13edcaaa2a
10 changed files with 98 additions and 528 deletions
+5 -9
View File
@@ -1,10 +1,6 @@
AUX cuda-config.in 407 BLAKE2B 5f7a0d50d774db58c180b767f00bead7c7dbf5f6b3b4a2f960dfc3b8450f7abf5c2b67c6620c5318f1331646dd2003d61c70a4c31359efd16ff418ecc9d0b446 SHA512 363903b999c43a47a48c52e8898c6044fadcc66d259338ee22863e859c2bc9873a2f1392aa83c9182486d3aa4eaeb5f164cf8ccf29cc74fd8ad56245f76a039a
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_12.8.1_570.124.06_linux.run 5382238770 BLAKE2B 6dff4eb32e97f960bdb2bd57d0dbf0920a9f85c19c26199adcac64eb9d30d7b6f6e2691c7a7a0b5b8249c7860cc685931080a3775c804f6e4e3294c43380e94f SHA512 2ac14ba054bf01924e1953053850f679ebdbc2b9150715398365464eae9d686cde2b82abb8f385b74e4eafa8d68421a9ea216c7647c08956ccba8b2299b50a6e
DIST cuda_12.8.1_570.124.06_linux_sbsa.run 4606631442 BLAKE2B 142c3a231f2a621c4d6a74059b72125baca83d2653ba95c726e3e3c12cf8a0a6b75ced7c0bdaa98450c3d2c2224e88886598191b594ac69be52ba5765bb30592 SHA512 108a75e0ca098b0fd514b3380d42b4752669201dcd68c41f2c1ecf9f29c216ac5937fa33d60e11be06e8a2ad8ae73aa49e6685a363ea77af943e1a1b936b8349
DIST cuda_12.9.0_575.51.03_linux.run 5839691742 BLAKE2B aead43ad3c127fcbe4e642ca3f82e46fe328aeb11d0b3b5abf2784948ce8b46dc703d959c9dd8dbe87697f52bc294636950129a60e2106d26e20e4eeb297c6f3 SHA512 92bef212ed5b5583ba1fdc12add2d7d9e8ced9abb48e336f5cd71bf507a841a855b0d7232d90d1c730ee21f5da2106c6f4acf8100852c1719e1a16715a665878
DIST cuda_12.9.0_575.51.03_linux_sbsa.run 5058547799 BLAKE2B c8b482fcd45529c2f810292be182cc6de703ab9e25018a220e18cb1b163e9bcb5c1648a898a658d678c5e229b83264b9b5a14309adca5c0de1189835e7d1fa18 SHA512 9d6d8b2e0529815eeb18aeefcf2e151c91960c0c7e29917b02d0e66cc68f396dda67fda24456031a94fb4d21348087428c26d18b25d891af621ede492a5d29cf
EBUILD nvidia-cuda-toolkit-12.8.1.ebuild 10532 BLAKE2B ee1bbad6df7891553bcc1e5e492452fe0e04044d74945ee80d41594dc942b42d6602c65b041608385a2972ab2fcf8deeeb466dac26496f626e41123a9c62df49 SHA512 6fcda1523062c44a5729b96cfe7806101d5887bf2fb3a23c0c692a4ba18a16af4b3d426991205dda4be3af96705c1267c1e359e9d20b88bf3c07d8d6b3e6433b
EBUILD nvidia-cuda-toolkit-12.9.0.ebuild 10531 BLAKE2B 425804309ff9a2c6033da81319cacc435eb8dc4330dc0be4e8041c310cacf09b488456099bb4d7bb3f1d18d59f28901e0dd3fdbcfb978ac63fc6b2b00fa9e1eb SHA512 d9b21b25be534aac956bb0ab2edd0b85f43884d658b619434040749f465a01aebf3bc9dd5f396a96ded53918b142def4c385acfbfd0e326616bddd026182f6a8
MISC metadata.xml 761 BLAKE2B a6ae653c6206cbc05349297499b6dde91bce6d543e10bd5ea915cfe9729dfa6f1eb954ae09c2e4d3997f51315ae090b38606c21b5099e750596ea66fdd93e817 SHA512 9133517d805201d25b651e48abed90394c88ef33a2571ab20b3b19d365f85a90478486c7c087c9150d7d9f6e4026873c5236c64ed649fd3bfc8f9b81479dcc59
AUX nvidia-cuda-toolkit-glibc-2.42.patch 2004 BLAKE2B 1aea9efaecfecdfa2024330c7c87c28637e8203d5ed2c362c851aef10c61ba8394f84836d7d4d2485c3024d534c6a1cf289ddd8810c59fe28522181babc40091 SHA512 4a31356ead484b78e685570f6aa9df7735e52f5f7999cf27362bad991c931b44118bcf116f079a36b157b64c75ece0db04bc99ecdb0d39342e7e9c3262703592
AUX parse_manifest.py 8488 BLAKE2B 8ac93a39276eaf89b41a5b0baa168b5974423077b0fd4b22841451514513c914fb4188863d73591f89975cc833dcb88bde289b0676f218715d8735a2d5c0f159 SHA512 4b2d9de215858d25319254666a22a184e26510a3488fc97a939704fab1e81a9baa363fc1168129618ce076de84d7acbeb71d98b8be272017f47b54c237d9b9a4
DIST cuda_13.3.0_610.43.02_linux.run 4294951215 BLAKE2B 738951e698addcda19ee500912cc8db68f13ae2a55c95f9b5b6e12a4ade9f6433dcce7a723af9ce9398f66d5010fb8ba7f04800185eee9242fea0b66c1ee6765 SHA512 9e882eba72b4a986f9ab25afb9566d54f8d73c88aa0634a6e3cd986f05c4c90fd6c4a8cc55f87fb4cedc0bda3a560079f9856a075c5c61b3b773787cc89792fe
EBUILD nvidia-cuda-toolkit-13.3.0.ebuild 10765 BLAKE2B 6e6d86572b46ef8e23158cc3210c2e0edd7ae4938100c05616a8df12b45546251960f437db8ad4e4d916abed355a5ca0b98ae09f93753c4114e5bfc9b2a561cf SHA512 e5f0f860bb04c3f16760e67ec5744df99dbf42a4499c2933b4aa8f15f8c0312f9577716dab7c7bc467308d4b264e2dfa0e0e728724dca02159be44c6cc5fb3fb
MISC metadata.xml 594 BLAKE2B 0b09446a13bed1e7506a2a75df9d00b0ce3367d4cd523d1f6faae886886e68d2e73db55e6ace11c8ed119fd756d0fbf748a263cbcc44693ac26d0046a68bb7ce SHA512 b4d11947cf539161b10cd14a99cd837ac5920b639fffb438a08ab9e0338c67531dc76bd000a1aba9532c6b98d6c71bbea528ec0b4a06caac8fe88b9fbbfdf343
@@ -1,72 +0,0 @@
From cae8ab12c9f981f110bb2e1318d9c5306e3a2d81 Mon Sep 17 00:00:00 2001
From: Paul Zander <negril.nx@gmail.com>
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 <negril.nx@gmail.com>
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
@@ -0,0 +1,49 @@
From 00713637a617aea1813ba7f09f0ba7de414415b9 Mon Sep 17 00:00:00 2001
From: Paul Zander <negril.nx+gentoo@gmail.com>
Date: Sun, 10 Aug 2025 12:31:03 +0200
Subject: [PATCH] Updates headers for glibc-2.42
Match the extern definitions in cuda-crt headers with the changes in glibc-2.42.
/usr/include/bits/mathcalls.h(206): error: exception specification is
incompatible with that of previous function "rsqrtf" (declared at line 657 of
/opt/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.h)
extern float rsqrtf (float __x) noexcept (true); extern float __rsqrtf (float
__x) noexcept (true);
See-Also:
https://sourceware.org/git/?p=glibc.git;a=commit;h=77261698b4e938020a1b2032709a54d942ba330f
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
diff --git a/builds/cuda_crt/include/crt/math_functions.h b/builds/cuda_crt/include/crt/math_functions.h
index 50a6646..d525a86 100644
--- a/builds/cuda_crt/include/crt/math_functions.h
+++ b/builds/cuda_crt/include/crt/math_functions.h
@@ -626,7 +626,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl sqrt(
*
* \note_accuracy_double
*/
+#if defined(__GLIBC__) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 42)
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x) noexcept (true);
+#else
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x);
+#endif
/**
* \ingroup CUDA_MATH_SINGLE
@@ -650,7 +654,11 @@ extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt
*
* \note_accuracy_single
*/
+#if defined(__GLIBC__) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 42)
+extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x) noexcept (true);
+#else
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x);
+#endif
#if defined(__QNX__) && !defined(_LIBCPP_VERSION)
namespace std {
--
2.50.1
@@ -157,7 +157,7 @@ def main():
# optional dir offset, we merge it into path
dir = ""
if "dir" in node.attrib:
dir = f" \"{Path(node.attrib["dir"])}\""
dir = f" \"{Path(node.attrib['dir'])}\""
filepath = basedir / path / file
@@ -183,12 +183,12 @@ def main():
subdir = ""
if "subdir" in node.attrib:
subdir = f" \"{node.attrib["subdir"]}\""
subdir = f" \"{node.attrib['subdir']}\""
print(f"{ind * (level + 1) * indent}dopcfile "
f"\"{lib_name}\" "
f"\"{lib_version}\" "
f"\"{node.attrib["description"]}\"{subdir}")
f"\"{node.attrib['description']}\"{subdir}")
# <desktopFile
# filename="nsight"
@@ -202,13 +202,13 @@ def main():
# create a .desktop file
for node in el.findall("./desktopFile"):
print(f"{ind * (level + 1) * indent}dodesktopFile \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["filename"]}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["name"]}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["categories"]}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["keywords"]}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["iconPath"]}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["execPath"]}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib["tryExecPath"]}\"")
print(f"{ind * (level + 2) * indent}\"{node.attrib['filename']}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib['name']}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib['categories']}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib['keywords']}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib['iconPath']}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib['execPath']}\" \\")
print(f"{ind * (level + 2) * indent}\"{node.attrib['tryExecPath']}\"")
# iterator over all nested packages
for node in el.findall("./package"):
+10 -12
View File
@@ -1,16 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sci@gentoo.org</email>
<name>Gentoo Science Project</name>
</maintainer>
<use>
<flag name="debugger">Install the CUDA debugger</flag>
<flag name="nsight">Install profiling and optimizing tools (nsight-compute, nsight-systems)</flag>
<flag name="profiler">Install the NVIDIA CUDA profiler (nvprof) and the related libraries</flag>
<flag name="rdma">Enable infiniband support via <pkg>sys-cluster/rdma-core</pkg></flag>
<flag name="sanitizer">Install compute-sanitizer tool</flag>
<flag name="vis-profiler">Install the NVIDIA CUDA visual profiler (nvvp)</flag>
</use>
<maintainer type="project">
<email>sci@gentoo.org</email>
<name>Gentoo Science Project</name>
</maintainer>
<use>
<flag name="debugger">Install the CUDA debugger</flag>
<flag name="profiler">Install the NVIDIA CUDA profiler (nvprof) and the related libraries</flag>
<flag name="rdma">Enable infiniband support via <pkg>sys-cluster/rdma-core</pkg></flag>
<flag name="sanitizer">Install compute-sanitizer tool</flag>
</use>
</pkgmetadata>
@@ -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_{11..14} )
inherit check-reqs toolchain-funcs
inherit python-r1
DRIVER_PV="575.51.03"
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="
|| (
<sys-devel/gcc-$(( GCC_MAX_VER + 1 ))_pre[cxx]
<llvm-core/clang-$(( CLANG_MAX_VER + 1 ))_pre
)
sys-process/numactl
debugger? (
${PYTHON_DEPS}
)
examples? (
media-libs/freeglut
media-libs/glu
)
rdma? ( sys-cluster/rdma-core )
"
BDEPEND="
$(python_gen_any_dep '
dev-python/defusedxml[${PYTHON_USEDEP}]
')
"
# CUDA_PATH="/opt/cuda-${PV}" #950207
CUDA_PATH="/opt/cuda"
QA_PREBUILT="${CUDA_PATH#/}/*"
PATCHES=(
"${FILESDIR}/nvidia-cuda-toolkit-glibc-2.41-r1.patch"
)
python_check_deps() {
python_has_version "dev-python/defusedxml[${PYTHON_USEDEP}]"
}
cuda-toolkit_check_reqs() {
if use amd64; then
export CHECKREQS_DISK_BUILD="6645M"
elif use arm64; then
export CHECKREQS_DISK_BUILD="6412M"
fi
"check-reqs_pkg_${EBUILD_PHASE}"
}
cuda_verify() {
if has_version "sys-apps/grep[pcre]"; then
local DRIVER_PV_info
DRIVER_PV_info="$(bash "${DISTDIR}/${A}" --info | grep -oP "cuda_${PV}.*run" | cut -d '_' -f 3)"
if [[ "${DRIVER_PV}" != "${DRIVER_PV_info}" ]]; then
die "check DRIVER_PV is ${DRIVER_PV} and should be ${DRIVER_PV_info}"
fi
fi
# rest only works in with unpacked sources
[[ "${EBUILD_PHASE}" != prepare ]] && return
# run self checks
local compiler_versions GCC_HAS_VER CLANG_HAS_VER
compiler_versions="$(
grep -oP "unsupported (GNU|clang) version.*(gcc versions later than|clang version must be less than) [0-9]*" \
"${S}"/builds/cuda_nvcc/targets/*/include/crt/host_config.h
)"
GCC_HAS_VER="$( echo "${compiler_versions}" | grep gcc | grep -oP "(?<=than )[0-9]*")"
if [[ "${GCC_MAX_VER}" -ne "${GCC_HAS_VER}" ]]; then
eqawarn "check GCC_MAX_VER is ${GCC_MAX_VER} and should be ${GCC_HAS_VER}"
fi
CLANG_HAS_VER="$(( $(echo "${compiler_versions}" | grep clang | grep -oP "(?<=than )[0-9]*") - 1 ))"
if [[ "${CLANG_MAX_VER}" -ne "${CLANG_HAS_VER}" ]]; then
eqawarn "check CLANG_MAX_VER is ${CLANG_MAX_VER} and should be ${CLANG_HAS_VER}"
fi
}
pkg_pretend() {
cuda-toolkit_check_reqs
}
pkg_setup() {
cuda-toolkit_check_reqs
# we need python for manifest parsing and to determine the supported python versions for cuda-gdb
python_setup
if use amd64; then
narch=x86_64
elif use arm64; then
narch=sbsa
else
die "unknown arch ${ARCH}"
fi
export narch
}
src_unpack() {
cuda_verify
local exclude=(
"cuda-installer"
"*-uninstaller"
"NVIDIA-Linux-${narch}-${DRIVER_PV}.run"
"builds/cuda_documentation"
"builds/cuda_nsight"
"builds/cuda_nvvp"
"builds/nsight_compute"
"builds/nsight_systems"
"builds/nvidia_fs"
)
bash "${DISTDIR}/${A}" --tar xf -X <(printf "%s\n" "${exclude[@]}") || die "failed to extract ${A}"
}
src_configure() {
:
}
src_compile() {
:
}
src_install() {
local -x SKIP_COMPONENTS=(
"Kernel_Objects"
"Visual_Tools"
"Documentation" # obsolete
"cuda-gdb-src" # not used
)
! use debugger && SKIP_COMPONENTS+=( "cuda-gdb" )
! use examples && SKIP_COMPONENTS+=( "Demo_Suite" )
! use profiler && SKIP_COMPONENTS+=( "cuda-cupti" "cuda-profiler-api" "nvprof" )
! use sanitizer && SKIP_COMPONENTS+=( "compute-sanitizer" )
dodir "${CUDA_PATH}"
into "${CUDA_PATH}"
dofile() {
debug-print-function "${FUNCNAME[0]}" "$@"
if [[ $# -ne 1 ]] && [[ $# -ne 2 ]]; then
die "${FUNCNAME[0]} must receive one or two arguments"
fi
local _DESTDIR
_DESTDIR="$(dirname "${CUDA_PATH}/${1%/}")${2:+/${2%/}}"
mkdir -p "${ED}${_DESTDIR}" || die "mkdir ${_DESTDIR} failed"
local dir
dir="$(dirname "${1}")"
if test -z "$(find "${dir}" -maxdepth 1 -name "$(basename "$1")" -print -quit)"; then
if [[ -e "${ED}${_DESTDIR}/$(basename "${1}")" ]]; then
return
fi
if [[ "$1" == "targets/x86_64-linux/lib/stubs/libcusolverMg*" ]] ||
[[ "$1" == "targets/x86_64-linux/lib/libcusparse.so.*" ]]; then
return
fi
return
fi
if [[ -e "${ED}${_DESTDIR}/$(basename "${1}")" ]]; then
# skip noisy warnings
if [[ "$(basename "${1}")" == "include" ]] ||
[[ "$(basename "${1}")" == "lib64" ]]; then
return
fi
eqawarn "${ED}${_DESTDIR}/$(basename "${1}") exists"
return
fi
eval mv -i "${1}" "${ED}${_DESTDIR}" || die "mv failed ${PWD} / ${1} -> ${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
}
@@ -1,27 +1,24 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# shellcheck disable=SC2317
EAPI=8
PYTHON_COMPAT=( python3_{11..14} )
PYTHON_COMPAT=( python3_{12..14} )
inherit check-reqs toolchain-funcs
inherit python-r1
DRIVER_PV="570.124.06"
GCC_MAX_VER="14"
CLANG_MAX_VER="19"
DRIVER_PV="610.43.02"
GCC_MAX_VER="15"
CLANG_MAX_VER="21"
DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)"
HOMEPAGE="https://developer.nvidia.com/cuda-zone"
HOMEPAGE="https://developer.nvidia.com/cuda"
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}"
@@ -30,7 +27,7 @@ LICENSE="NVIDIA-CUDA"
SLOT="0/${PV}" # UNSLOTTED
# SLOT="${PV}" # SLOTTED
KEYWORDS="-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux"
KEYWORDS="-* ~amd64"
IUSE="debugger examples profiler rdma sanitizer"
RESTRICT="bindist mirror strip test"
@@ -63,10 +60,6 @@ BDEPEND="
CUDA_PATH="/opt/cuda"
QA_PREBUILT="${CUDA_PATH#/}/*"
PATCHES=(
"${FILESDIR}/nvidia-cuda-toolkit-glibc-2.41-r1.patch"
)
python_check_deps() {
python_has_version "dev-python/defusedxml[${PYTHON_USEDEP}]"
}
@@ -278,6 +271,16 @@ src_install() {
rm "${ED}/${CUDA_PATH}/targets/${narch}-linux/lib/libcufile_rdma"* || die "failed to remove rdma files"
fi
# CUDA 13.0.3 added the cuda_crt component which drops its headers
# at /opt/cuda/include/crt/ (arch-independent). Fold them into the
# per-arch include tree so the /opt/cuda/include -> targets/.../include
# symlink below remains the canonical entry point.
if [[ -d "${ED}/${CUDA_PATH}/include/crt" ]]; then
mv "${ED}/${CUDA_PATH}/include/crt" \
"${ED}/${CUDA_PATH}/targets/${narch}-linux/include/" || die
rmdir "${ED}/${CUDA_PATH}/include" || die
fi
# Add include and lib symlinks
dosym "targets/${narch}-linux/include" "${CUDA_PATH}/include"
dosym "targets/${narch}-linux/lib" "${CUDA_PATH}/lib64"
@@ -311,7 +314,7 @@ src_install() {
# 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}" )
local cuda_supported_gcc=( 8.5 9.5 10 11 12 13 14 "${GCC_MAX_VER}" )
sed \
-e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc[*]}:g" \
@@ -1,16 +0,0 @@
BDEPEND=|| ( ( dev-lang/python:3.14 dev-python/defusedxml[python_targets_python3_14(-)] ) ( dev-lang/python:3.13 dev-python/defusedxml[python_targets_python3_13(-)] ) ( dev-lang/python:3.12 dev-python/defusedxml[python_targets_python3_12(-)] ) )
DEFINED_PHASES=compile configure install postinst pretend setup unpack
DESCRIPTION=NVIDIA CUDA Toolkit (compiler and friends)
EAPI=8
HOMEPAGE=https://developer.nvidia.com/cuda-zone
INHERIT=check-reqs toolchain-funcs python-r1
IUSE=debugger examples profiler rdma sanitizer python_targets_python3_12 python_targets_python3_13 python_targets_python3_14
KEYWORDS=-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux
LICENSE=NVIDIA-CUDA
RDEPEND=|| ( <sys-devel/gcc-15_pre[cxx] <llvm-core/clang-20_pre ) sys-process/numactl debugger? ( python_targets_python3_12? ( dev-lang/python:3.12 ) python_targets_python3_13? ( dev-lang/python:3.13 ) python_targets_python3_14? ( dev-lang/python:3.14 ) ) examples? ( media-libs/freeglut media-libs/glu ) rdma? ( sys-cluster/rdma-core )
REQUIRED_USE=|| ( python_targets_python3_12 python_targets_python3_13 python_targets_python3_14 )
RESTRICT=bindist mirror strip test
SLOT=0/12.8.1
SRC_URI=amd64? ( https://developer.download.nvidia.com/compute/cuda/12.8.1/local_installers/cuda_12.8.1_570.124.06_linux.run ) arm64? ( https://developer.download.nvidia.com/compute/cuda/12.8.1/local_installers/cuda_12.8.1_570.124.06_linux_sbsa.run )
_eclasses_=check-reqs 12ab9d3fc16bfe1f87c6fb652324b57c toolchain-funcs 58a918e3a42d0156f010dcfd43725be5 out-of-source-utils 8e5093bd27b7f541a1913271f25d633a multibuild 83db098a835f71feb71761f72a694aa2 eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 python-utils-r1 18a01bee4e486884d7457cfacde74099 python-r1 5fdca77e34fc9af7d6eb47689f33f6bf
_md5_=d28bc81c97811cd779046178803243ec
@@ -1,16 +0,0 @@
BDEPEND=|| ( ( dev-lang/python:3.14 dev-python/defusedxml[python_targets_python3_14(-)] ) ( dev-lang/python:3.13 dev-python/defusedxml[python_targets_python3_13(-)] ) ( dev-lang/python:3.12 dev-python/defusedxml[python_targets_python3_12(-)] ) )
DEFINED_PHASES=compile configure install postinst pretend setup unpack
DESCRIPTION=NVIDIA CUDA Toolkit (compiler and friends)
EAPI=8
HOMEPAGE=https://developer.nvidia.com/cuda-zone
INHERIT=check-reqs toolchain-funcs python-r1
IUSE=debugger examples profiler rdma sanitizer python_targets_python3_12 python_targets_python3_13 python_targets_python3_14
KEYWORDS=-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux
LICENSE=NVIDIA-CUDA
RDEPEND=|| ( <sys-devel/gcc-15_pre[cxx] <llvm-core/clang-20_pre ) sys-process/numactl debugger? ( python_targets_python3_12? ( dev-lang/python:3.12 ) python_targets_python3_13? ( dev-lang/python:3.13 ) python_targets_python3_14? ( dev-lang/python:3.14 ) ) examples? ( media-libs/freeglut media-libs/glu ) rdma? ( sys-cluster/rdma-core )
REQUIRED_USE=|| ( python_targets_python3_12 python_targets_python3_13 python_targets_python3_14 )
RESTRICT=bindist mirror strip test
SLOT=0/12.9.0
SRC_URI=amd64? ( https://developer.download.nvidia.com/compute/cuda/12.9.0/local_installers/cuda_12.9.0_575.51.03_linux.run ) arm64? ( https://developer.download.nvidia.com/compute/cuda/12.9.0/local_installers/cuda_12.9.0_575.51.03_linux_sbsa.run )
_eclasses_=check-reqs 12ab9d3fc16bfe1f87c6fb652324b57c toolchain-funcs 58a918e3a42d0156f010dcfd43725be5 out-of-source-utils 8e5093bd27b7f541a1913271f25d633a multibuild 83db098a835f71feb71761f72a694aa2 eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 python-utils-r1 18a01bee4e486884d7457cfacde74099 python-r1 5fdca77e34fc9af7d6eb47689f33f6bf
_md5_=3e285687a7aea98c7b573ccd6bd3f947
@@ -2,15 +2,15 @@ BDEPEND=|| ( ( dev-lang/python:3.14 dev-python/defusedxml[python_targets_python3
DEFINED_PHASES=compile configure install postinst pretend setup unpack
DESCRIPTION=NVIDIA CUDA Toolkit (compiler and friends)
EAPI=8
HOMEPAGE=https://developer.nvidia.com/cuda-zone
HOMEPAGE=https://developer.nvidia.com/cuda
INHERIT=check-reqs toolchain-funcs python-r1
IUSE=debugger examples profiler rdma sanitizer python_targets_python3_12 python_targets_python3_13 python_targets_python3_14
KEYWORDS=-* ~amd64 ~arm64 ~amd64-linux ~arm64-linux
KEYWORDS=-* ~amd64
LICENSE=NVIDIA-CUDA
RDEPEND=|| ( <sys-devel/gcc-15_pre[cxx] <llvm-core/clang-20_pre ) sys-process/numactl debugger? ( python_targets_python3_12? ( dev-lang/python:3.12 ) python_targets_python3_13? ( dev-lang/python:3.13 ) python_targets_python3_14? ( dev-lang/python:3.14 ) ) examples? ( media-libs/freeglut media-libs/glu ) rdma? ( sys-cluster/rdma-core )
RDEPEND=|| ( <sys-devel/gcc-16_pre[cxx] <llvm-core/clang-22_pre ) sys-process/numactl debugger? ( python_targets_python3_12? ( dev-lang/python:3.12 ) python_targets_python3_13? ( dev-lang/python:3.13 ) python_targets_python3_14? ( dev-lang/python:3.14 ) ) examples? ( media-libs/freeglut media-libs/glu ) rdma? ( sys-cluster/rdma-core )
REQUIRED_USE=|| ( python_targets_python3_12 python_targets_python3_13 python_targets_python3_14 )
RESTRICT=bindist mirror strip test
SLOT=0/13.3.0
SRC_URI=amd64? ( https://developer.download.nvidia.com/compute/cuda/13.3.0/local_installers/cuda_13.3.0_575.51.03_linux.run ) arm64? ( https://developer.download.nvidia.com/compute/cuda/13.3.0/local_installers/cuda_13.3.0_575.51.03_linux_sbsa.run )
_eclasses_=check-reqs 12ab9d3fc16bfe1f87c6fb652324b57c toolchain-funcs 58a918e3a42d0156f010dcfd43725be5 out-of-source-utils 8e5093bd27b7f541a1913271f25d633a multibuild 83db098a835f71feb71761f72a694aa2 eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 python-utils-r1 18a01bee4e486884d7457cfacde74099 python-r1 5fdca77e34fc9af7d6eb47689f33f6bf
_md5_=3e285687a7aea98c7b573ccd6bd3f947
SRC_URI=amd64? ( https://developer.download.nvidia.com/compute/cuda/13.3.0/local_installers/cuda_13.3.0_610.43.02_linux.run )
_eclasses_=check-reqs 12ab9d3fc16bfe1f87c6fb652324b57c eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd multibuild 83db098a835f71feb71761f72a694aa2 multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 out-of-source-utils 8e5093bd27b7f541a1913271f25d633a python-r1 5fdca77e34fc9af7d6eb47689f33f6bf python-utils-r1 18a01bee4e486884d7457cfacde74099 toolchain-funcs 58a918e3a42d0156f010dcfd43725be5
_md5_=5527a2f3c5aa917b559df922dc4ac444