diff options
Diffstat (limited to 'dev-util/nvidia-cuda-toolkit')
-rw-r--r-- | dev-util/nvidia-cuda-toolkit/Manifest | 2 | ||||
-rw-r--r-- | dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.4.1.ebuild | 252 |
2 files changed, 254 insertions, 0 deletions
diff --git a/dev-util/nvidia-cuda-toolkit/Manifest b/dev-util/nvidia-cuda-toolkit/Manifest index dc2045ac7830..e998ffbd28dc 100644 --- a/dev-util/nvidia-cuda-toolkit/Manifest +++ b/dev-util/nvidia-cuda-toolkit/Manifest @@ -4,11 +4,13 @@ DIST cuda_11.1.1_455.32.00_linux.run 3532172082 BLAKE2B f4af6bd87c419c002b4913ea DIST cuda_11.2.2_460.32.03_linux.run 3057439068 BLAKE2B c3f3cd9eaaa4f91eb8080e7cafe1280f9bbc9cfc71ce1a6115af1dd348b83d30eed945609bf87e00d4873bede1fa9136fc4a7f393fd31db4e6406dc76086bc22 SHA512 e28d7d2eabd96df9e18f8e55f61adda39b07c2223605f77a6c2d92a02f7b57e9ce8b83d4b4de1124faa5670509d204d3db70c03b18af5cc5964b6ed6653d6a22 DIST cuda_11.3.1_465.19.01_linux.run 3158494112 BLAKE2B 0316c6a9bf062f2503c94604b51dea9a8d19c516e304e43ccdbc79f305a242664b7f029f7b7086edd7adc37d92a3bae074f005b3be412e1361917794cb824686 SHA512 e2db8b4dcb5f6aee2c3e8a8a6848186cdcdd7cd9d5f4bfd069bd3dc2ea500797c66a4592f0e28dcbee6c3611d1f88b6fda6afcd734aa9ef45f4aa17a1527aedb DIST cuda_11.4.0_470.42.01_linux.run 3773273383 BLAKE2B 2e466728b6ca9d17dc3caadce13b58c8ba1464c2adeb09739f428aea96f5794c87bf84ca2b81c1019d45223ff5e519503d798032a800a370c7e41517d790f5c4 SHA512 17165102e7f64da77588fd47feeee5ce3f3151a2b482bdc005427ad77ada5d0ff5a51dcd40a27a467cd5988968469476ba90b0191aed993806d284833a08ccb1 +DIST cuda_11.4.1_470.57.02_linux.run 3796641626 BLAKE2B da6a454bb1765833af8c01f2106a1e0f3e33a6a91354a527006fd0335655872b499bb51662c8e224437368ee37c3bf15f0cf0c4bccc02750e46480ceb6b84677 SHA512 a7a2415e6a0ce6a841e15fccc5c6126d8f134ebb7045e11e49d136aed264c236b91cc959320f763d0d7d878d9d83e09310a51c0ac30c926007dae07242a952de DIST cuda_9.2.88_396.26_linux.run 1758421686 BLAKE2B 5068b2dfae87e43c124a6a72ac98b7c562aebc7161e7c977cfba68342127e99705228be531aa5bb8af0318e17c4ef8fe36257452d0f507fc3b82e3fbd0184bdc SHA512 2d0d87926e11a1b21d6d3377138753df458a53ba9539d8399f9f252e0784cb41e2c63a5c724ca81ded82b9657b97fda51d812b467b0827e7d361aa2ad73b2dba EBUILD nvidia-cuda-toolkit-10.2.89-r3.ebuild 3925 BLAKE2B 5b193f9ba23ffe42a4a23a5e4dc0b526246286fa27c14b7d1bf41e50e24ab46c619f73e371bc1c0034ecd549839631c9f184b2ece8499150e9fa6350ed137add SHA512 30b1a97475666e9e19a1390ebac946d9c1c1b8c61fd35a44239ed751b53943eb66b4002e3b17bf9dff33d45a730db7b1b7c4d0a57cc09bac38609822eebe9fa6 EBUILD nvidia-cuda-toolkit-11.1.1-r2.ebuild 6238 BLAKE2B f658446f6f597fabcf7314ecd1f468ba9823047ea2344f6505672af159377902389ad430d80cc3a4bcfbfb7731824b2ecd9a7d7e5558a00dabe7a01984aae99c SHA512 d84f04a2995c7baeffa2ffae64e907af1476835c0cfc07b869d1736a7dd168d70cf49a1be139990e17d42b4ee60fc0770480f2a9d6d2bfc4d20b23c483f64c14 EBUILD nvidia-cuda-toolkit-11.2.2.ebuild 7119 BLAKE2B cb904f01e369415a5386873c6da3d4d89dbad96e998c47190fc5f6eef2261df4d7bc96c508eb19031fc15a6dd7fd5340bfeb544f79f4fa1b7fdcb7109c1f764d SHA512 366005e64ce6ab58d61956a341dbf654df9876003581ef500dafb3e35c7a86af120267390365de55c91927bcb4edea08722708385be32fce0bad34cd7cc7b070 EBUILD nvidia-cuda-toolkit-11.3.1.ebuild 7121 BLAKE2B 4e1a8edfedd8972445ec7eb413b86707f6accc3acfdda75620a4e14a36376205843cc73872b8e35845e6526cb147e64132d7c4cdc29e3ae218b559e67c3fda39 SHA512 46b28a75e4adea42d6ef06065a38aa13c4bb0acd1ff924b0e81ddf2f8b437b1e18bef85b81d3c40cb58e05934fa645ec08dbea5c2972d09bb0998f0c7a36eb4b EBUILD nvidia-cuda-toolkit-11.4.0.ebuild 7121 BLAKE2B 0db4166fc71c33c2bdf52c56e3ba17d502dbd20fbebb6ac65ba5887cefac8504e9af40584e3cd354fd25ee4f4c49eb39c87f04df418e2aabbda7838c937c3931 SHA512 99eea9176c4b611fa769c7be7da58afbad579eb2c732490136bd218d5aea73217fd4b4bb0259d00eb150617fbf6d4c76433cf528c6f7ea1381a1ee30227376a1 +EBUILD nvidia-cuda-toolkit-11.4.1.ebuild 7121 BLAKE2B f982e4c79ef4a748a91d0c12af77b3ed60fa1925bb992ecbc57e73521e9ba86d0183966756b81f2ba6ebc383ed229654e2b4d6893bb62902357d7479c550845f SHA512 a5d720bc4b784aae3db46d4c5455f5d8bd74304fed8d4539b38be63d6f696b0aea5e8727f6a2814347c67744cbbdb99f52bc10ef1bd54b168a28487e766037e6 EBUILD nvidia-cuda-toolkit-9.2.88-r1.ebuild 3348 BLAKE2B 4239f80dcd8e12f2bd275543a0587e632bd7f96ad3f5eaf251f4f52012ceceeeaa62e9613e92707186ee2ce43041d0d0a4d2f6ed8d90ea5a9f68b59f78c6a6c1 SHA512 087f2e5a7ec5a14dc56f8a71756e8a69f89cb582aaf7473003126257135ac7ea9a876eddea08a1458be19282df374af1d24a19fcafa0d5ed3ae3b559645c4538 MISC metadata.xml 724 BLAKE2B fd9e30ae430f56599bab7004b9cd46a79bd9b94e75b0a4574ae393d8979b5e40862bf30d110d5d47186d74e629f035f854cea720d8393709d95a9c14b1185a26 SHA512 3a77849ec1bf2e61da35ffd76c20464b5de745c73abd14ffcb7e7d3b2f52e7d114c7d4630292ea219a23e327f1b6a0a8ec488a8cbdaf763a73554f17f50c2f7f diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.4.1.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.4.1.ebuild new file mode 100644 index 000000000000..70aa06012a1a --- /dev/null +++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.4.1.ebuild @@ -0,0 +1,252 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit check-reqs toolchain-funcs unpacker + +DRIVER_PV="470.57.02" + +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=" + <sys-devel/gcc-11_pre[cxx] + >=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() { + 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 +} |