From 9aa80713372911cec499b3adb2cd746790920916 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 29 Jun 2021 10:15:54 +0100 Subject: gentoo resync : 29.06.2021 --- dev-util/nvidia-cuda-toolkit/Manifest | 2 + .../nvidia-cuda-toolkit-11.3.1.ebuild | 253 +++++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.3.1.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 8b99b484d88d..e35fffcf588f 100644 --- a/dev-util/nvidia-cuda-toolkit/Manifest +++ b/dev-util/nvidia-cuda-toolkit/Manifest @@ -5,11 +5,13 @@ DIST cuda_11.1.1_455.32.00_linux.run 3532172082 BLAKE2B f4af6bd87c419c002b4913ea DIST cuda_11.2.0_460.27.04_linux.run 3046790184 BLAKE2B 5330bc2e12ff131eb993610c95b22e6358b11d6a7a952625a4e88ed856769256c02e165ac7bf6cc43236052c8427cee17bf1e7346995dc2eba84d93c5d444eb3 SHA512 0aa7390490b93be7f359327a8fe364a44b538e742c7ccd560e9bbb40ed8613539c37fcb4aa71a2fbfa0bfdb0416ab43bbdcc09cd0c81db3f1a07b37318d6b2b3 DIST cuda_11.2.2_460.32.03_linux.run 3057439068 BLAKE2B c3f3cd9eaaa4f91eb8080e7cafe1280f9bbc9cfc71ce1a6115af1dd348b83d30eed945609bf87e00d4873bede1fa9136fc4a7f393fd31db4e6406dc76086bc22 SHA512 e28d7d2eabd96df9e18f8e55f61adda39b07c2223605f77a6c2d92a02f7b57e9ce8b83d4b4de1124faa5670509d204d3db70c03b18af5cc5964b6ed6653d6a22 DIST cuda_11.3.0_465.19.01_linux.run 3029622552 BLAKE2B ca64af09dc68b085a589b5756e3bfce72550e262b778aad06eb1f5b77d9cb30447fb8b57f5f6c3d210b49cd300e0db153c5eec1d51384b6889855a076ee62d07 SHA512 3120455e9513f62f82108539c5a4ccb4e9aa64beb66f816644e559bb8b573ff582c865c6a346ca39c6afb775c0c5fd567f5d31f0a0c5b927d6be849cd2905749 +DIST cuda_11.3.1_465.19.01_linux.run 3158494112 BLAKE2B 0316c6a9bf062f2503c94604b51dea9a8d19c516e304e43ccdbc79f305a242664b7f029f7b7086edd7adc37d92a3bae074f005b3be412e1361917794cb824686 SHA512 e2db8b4dcb5f6aee2c3e8a8a6848186cdcdd7cd9d5f4bfd069bd3dc2ea500797c66a4592f0e28dcbee6c3611d1f88b6fda6afcd734aa9ef45f4aa17a1527aedb DIST cuda_9.2.88_396.26_linux.run 1758421686 BLAKE2B 5068b2dfae87e43c124a6a72ac98b7c562aebc7161e7c977cfba68342127e99705228be531aa5bb8af0318e17c4ef8fe36257452d0f507fc3b82e3fbd0184bdc SHA512 2d0d87926e11a1b21d6d3377138753df458a53ba9539d8399f9f252e0784cb41e2c63a5c724ca81ded82b9657b97fda51d812b467b0827e7d361aa2ad73b2dba EBUILD nvidia-cuda-toolkit-10.2.89-r3.ebuild 3989 BLAKE2B f965c3c19e7b52156d2daf3473fe563da7bf7b77516a7291735d37dc30f61bb3c6502a9d2807b7f33140e59eae2b8991e5c6881f3b4c6fa462e5093968b75c27 SHA512 611397a2c371a7aedb452d12e2acfa02dc06752b2558eedb12be852788c8050b77883a06c32b3eff131ac54a517a2c852500aa65deeaa0947a0e91f42b50954d EBUILD nvidia-cuda-toolkit-11.1.1-r2.ebuild 6302 BLAKE2B 7227d9bd6cfd0232067c035d8c98f6fe2153a53db4e9a82f3a4990ed07dea8c1de129016d29de1adf0bbfe292aafe406ae0b3d4504de2ccfba00426ba5edf049 SHA512 1242e6fe1647f83a9f8c76f58f71ce1b2f0f397fefe752fb6b978152c5d798f444c2cddd333adcd768172f44bc33a684abed176e2517351d71dd427e45b218fb EBUILD nvidia-cuda-toolkit-11.2.0-r3.ebuild 7301 BLAKE2B 5d52c2bffc7edba866bd76470ff0663018f22a0d276f8d1ab3022ae858ffb3c68f3746e5da830f2a6149810199f76b3ba349e3d83111b5cf2fca50d8245adbb1 SHA512 d418963abcb41ab8878cdd708bf4164d58fa4a3b54bfa7e9058a8786a5a85ae30afee2e893f1f174b5ac384b242512a294cb86f020f2b03adaca949270a11013 EBUILD nvidia-cuda-toolkit-11.2.2.ebuild 7183 BLAKE2B 7f0680251da83372ded40804a0f59550c11fd69b2f3d97e16345c2323a8f460fe269830364b25c7894634015c7d5caad28c155a5102b03885066efda2a5b0181 SHA512 95e2644ddbf9985cd507cb3f2caf882f14a87517b62c1e5c6f1e55a3410f8144542df071a0e8851e5e716c6ffd14b67518417e7a64adff6eba35435479a31158 EBUILD nvidia-cuda-toolkit-11.3.0-r1.ebuild 7190 BLAKE2B 74f757360a13cad90881da62e92de13a456a502d20fa967f8e45bd2dc2d20c61cfdf51b586a6e675832737a57cfb1140d269968c2912d6d2b49e15a772628c21 SHA512 78403780993009a26f84939310fe365d790d86d4fcfdf4640d452e18c9cc312a652771c61c9e83db61e1bd1c413311820fd3a02d59a4d4343d87413379c3686d +EBUILD nvidia-cuda-toolkit-11.3.1.ebuild 7185 BLAKE2B f224322f449159d66795e97b048b124dbe89636e6f6cacb920418dd40b49425c240ad6d95a5ebe0f64bf5d8e6c5ebd059a6470872e46f64eef89dfb4ccf2eaa5 SHA512 221ec1d80ae94897ec1b207c86c555dfe859c046130dac760f2d10d535e8e038baaa99474fc9f78e08547ea18d2dae680bd4a8cbe459712ea0fa9f95faa585d8 EBUILD nvidia-cuda-toolkit-9.2.88-r1.ebuild 3423 BLAKE2B 3b54cc972086d15b32a839afb562accb5067be1d9c9a3438455e0d1748169ff9cd6c433510054b8cfc3c0cc95d9133dc4b84d3c18acf27b0841692e61c41de6a SHA512 db45c42e5f1b6b48ea4e77c52e7519e2a3c4de82a3439b4e69414fb85f8ae2973d0158d4c04dbbd4b803bcff026bb80fcd367a9005c6644609ae7cc09eaa26a5 MISC metadata.xml 724 BLAKE2B fd9e30ae430f56599bab7004b9cd46a79bd9b94e75b0a4574ae393d8979b5e40862bf30d110d5d47186d74e629f035f854cea720d8393709d95a9c14b1185a26 SHA512 3a77849ec1bf2e61da35ffd76c20464b5de745c73abd14ffcb7e7d3b2f52e7d114c7d4630292ea219a23e327f1b6a0a8ec488a8cbdaf763a73554f17f50c2f7f diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.3.1.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.3.1.ebuild new file mode 100644 index 000000000000..60cb5fa59a90 --- /dev/null +++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.3.1.ebuild @@ -0,0 +1,253 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit check-reqs cuda toolchain-funcs unpacker + +DRIVER_PV="465.19.01" + +DESCRIPTION="NVIDIA CUDA Toolkit (compiler and friends)" +HOMEPAGE="https://developer.nvidia.com/cuda-zone" +SRC_URI="https://developer.download.nvidia.com/compute/cuda/${PV}/local_installers/cuda_${PV}_${DRIVER_PV}_linux.run" +S="${WORKDIR}" + +LICENSE="NVIDIA-CUDA" +SLOT="0/${PV}" +KEYWORDS="-* ~amd64 ~amd64-linux" +IUSE="debugger nsight profiler vis-profiler sanitizer" +RESTRICT="bindist mirror" + +BDEPEND="" +RDEPEND=" + =x11-drivers/nvidia-drivers-${DRIVER_PV} + debugger? ( + dev-libs/openssl + sys-libs/libtermcap-compat + sys-libs/ncurses-compat:5[tinfo] + ) + vis-profiler? ( + dev-libs/openssl + >=virtual/jre-1.8:* + )" + +QA_PREBUILT="opt/cuda/*" +CHECKREQS_DISK_BUILD="6800M" + +pkg_setup() { + # We don't like to run cuda_pkg_setup as it depends on us + check-reqs_pkg_setup +} + +src_prepare() { + # ATTENTION: change requires revbump + local cuda_supported_gcc="8.5 9.3 9.4 10.2 10.3" + + sed \ + -e "s:CUDA_SUPPORTED_GCC:${cuda_supported_gcc}:g" \ + "${FILESDIR}"/cuda-config.in > "${T}"/cuda-config || die + + default +} + +src_install() { + local cudadir=/opt/cuda + local ecudadir="${EPREFIX}${cudadir}" + local pathextradirs ldpathextradirs + dodir ${cudadir} + into ${cudadir} + + # Install standard sub packages + local builddirs=( + builds/cuda_{cudart,cuobjdump,memcheck,nvcc,nvdisasm,nvml_dev,nvprune,nvrtc,nvtx,thrust} + builds/lib{cublas,cufft,curand,cusolver,cusparse,npp,nvjpeg} + $(usex profiler "builds/cuda_nvprof builds/cuda_cupti" "") + $(usex vis-profiler "builds/cuda_nvvp" "") + $(usex debugger "builds/cuda_gdb" "") + ) + + local d f + for d in "${builddirs[@]}"; do + ebegin "Installing ${d}" + [[ -d ${d} ]] || die "Directory does not exist: ${d}" + + if [[ -d ${d}/bin ]]; then + for f in ${d}/bin/*; do + if [[ -f ${f} ]]; then + dobin "${f}" + else + insinto ${cudadir}/bin + doins -r "${f}" + fi + done + fi + + insinto ${cudadir} + if [[ -d ${d}/targets ]]; then + doins -r "${d}"/targets + fi + if [[ -d ${d}/share ]]; then + doins -r "${d}"/share + fi + if [[ -d ${d}/extras ]]; then + doins -r "${d}"/extras + fi + eend + done + dobin "${T}"/cuda-config + + doins builds/EULA.txt + # nvml and nvvm need special handling + ebegin "Installing nvvm" + doins -r builds/cuda_nvcc/nvvm + fperms +x ${cudadir}/nvvm/bin/cicc + eend + + ebegin "Installing nvml" + doins -r builds/cuda_nvml_dev/nvml + eend + + if use sanitizer; then + ebegin "Installing sanitizer" + dobin builds/integration/Sanitizer/compute-sanitizer + doins -r builds/cuda_sanitizer_api/compute-sanitizer + # special handling for the executable + fperms +x ${cudadir}/compute-sanitizer/compute-sanitizer + eend + fi + + use profiler && ldpathextradirs+=":${ecudadir}/extras/CUPTI/lib64" + + if use vis-profiler; then + ebegin "Installing libnvvp" + doins -r builds/cuda_nvvp/libnvvp + # special handling for the executable + fperms +x ${cudadir}/libnvvp/nvvp + eend + pathextradirs+=":${ecudadir}/libnvvp" + fi + + if use nsight; then + local ncu_dir=$(grep -o 'nsight-compute-[0-9][0-9\.]*' -m1 manifests/cuda_x86_64.xml) + ebegin "Installing ${ncu_dir}" + mv builds/nsight_compute builds/${ncu_dir} || die + doins -r builds/${ncu_dir} + + # check this list on every bump + local exes=( + ${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/libexec/QtWebEngineProcess + ${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/CrashReporter + ${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/ncu-ui + ${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/ncu-ui.bin + ${ncu_dir}/target/linux-desktop-glibc_2_11_3-x64/TreeLauncherTargetLdPreloadHelper + ${ncu_dir}/target/linux-desktop-glibc_2_11_3-x64/TreeLauncherSubreaper + ${ncu_dir}/target/linux-desktop-glibc_2_11_3-x64/ncu + ) + + dobin builds/integration/nsight-compute/{ncu,ncu-ui,nv-nsight-cu,nv-nsight-cu-cli} + eend + + local nsys_dir=$(grep -o 'nsight-systems-[0-9][0-9\.]*' -m1 manifests/cuda_x86_64.xml) + ebegin "Installing ${nsys_dir}" + mv builds/nsight_systems builds/${nsys_dir} || die + doins -r builds/${nsys_dir} + + # check this list on every bump + exes+=( + ${nsys_dir}/host-linux-x64/nsys-ui + ${nsys_dir}/host-linux-x64/nsys-ui.bin + ${nsys_dir}/host-linux-x64/ResolveSymbols + ${nsys_dir}/host-linux-x64/ImportNvtxt + ${nsys_dir}/host-linux-x64/CrashReporter + ${nsys_dir}/host-linux-x64/QdstrmImporter + ${nsys_dir}/host-linux-x64/libexec/QtWebEngineProcess + ${nsys_dir}/target-linux-x64/nsys + ${nsys_dir}/target-linux-x64/launcher + ${nsys_dir}/target-linux-x64/nvgpucs + ${nsys_dir}/target-linux-x64/nsys-launcher + ${nsys_dir}/target-linux-x64/sqlite3 + ${nsys_dir}/target-linux-x64/python/bin/python + ) + + dobin builds/integration/nsight-systems/{nsight-sys,nsys,nsys-exporter,nsys-ui} + eend + + # nsight scripts and binaries need to have their executable bit set, #691284 + for f in "${exes[@]}"; do + fperms +x ${cudadir}/${f} + done + + # remove foreign archs (triggers SONAME warning, #749903) + rm -r "${ED}"/${cudadir}/${ncu_dir}/target/linux-desktop-glibc_2_19_0-ppc64le || die + rm -r "${ED}"/${cudadir}/${ncu_dir}/target/linux-desktop-t210-a64 || die + rm -r "${ED}"/${cudadir}/${nsys_dir}/target-linux-armv8 || die + + # TODO: unbundle qt5 + # TODO: unbundle boost + # TODO: unbundle icu + # TODO: unbundle openssl + # TODO: unbundle mesa + # TODO: unbundle libz + # TODO: unbundle libstdc++ + # TODO: unbundle libSshClient + # TODO: unbundle sqlite + # TODO: unbundle libpfm ? + fi + + # Add include and lib symlinks + dosym targets/x86_64-linux/include ${cudadir}/include + dosym targets/x86_64-linux/lib ${cudadir}/lib64 + + newenvd - 99cuda <<-EOF + PATH=${ecudadir}/bin${pathextradirs} + ROOTPATH=${ecudadir}/bin + LDPATH=${ecudadir}/lib64:${ecudadir}/nvvm/lib64${ldpathextradirs} + EOF + + # Cuda prepackages libraries, don't revdep-build on them + insinto /etc/revdep-rebuild + newins - 80${PN} <<-EOF + SEARCH_DIRS_MASK="${ecudadir}" + EOF + # TODO: Add pkgconfig files for installed libraries +} + +pkg_postinst_check() { + local a="$(${EROOT}/opt/cuda/bin/cuda-config -s)" + local b="0.0" + local v + for v in ${a}; do + ver_test "${v}" -gt "${b}" && b="${v}" + done + + # if gcc and if not gcc-version is at least greatest supported + if tc-is-gcc && \ + ver_test $(gcc-version) -gt "${b}"; then + ewarn + ewarn "gcc > ${b} will not work with CUDA" + ewarn "Make sure you set an earlier version of gcc with gcc-config" + ewarn "or append --compiler-bindir= pointing to a gcc bindir like" + ewarn "--compiler-bindir=${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/gcc${b}" + ewarn "to the nvcc compiler flags" + ewarn + fi +} + +pkg_postinst() { + if [[ ${MERGE_TYPE} != binary ]]; then + pkg_postinst_check + fi + + if use profiler || use nsight; then + einfo + einfo "nvidia-drivers restrict access to performance counters." + einfo "You'll need to either run profiling tools (nvprof, nsight) " + 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