diff options
author | Jason Zaman <perfinion@gentoo.org> | 2020-10-24 01:27:48 -0700 |
---|---|---|
committer | Jason Zaman <perfinion@gentoo.org> | 2020-10-24 01:34:39 -0700 |
commit | bdc936cc0b5561696bb6bc56daa2939e36721f85 (patch) | |
tree | c0b1377ffa0e5fdca8af1352dde95cc2ed62ee78 /dev-util/nvidia-cuda-toolkit | |
parent | app-admin/calamares: Mask all failing tests (diff) | |
download | gentoo-bdc936cc0b5561696bb6bc56daa2939e36721f85.tar.gz gentoo-bdc936cc0b5561696bb6bc56daa2939e36721f85.tar.bz2 gentoo-bdc936cc0b5561696bb6bc56daa2939e36721f85.zip |
dev-util/nvidia-cuda-toolkit: bump 11.1
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Jason Zaman <perfinion@gentoo.org>
Diffstat (limited to 'dev-util/nvidia-cuda-toolkit')
-rw-r--r-- | dev-util/nvidia-cuda-toolkit/Manifest | 1 | ||||
-rw-r--r-- | dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.1.0.ebuild | 228 |
2 files changed, 229 insertions, 0 deletions
diff --git a/dev-util/nvidia-cuda-toolkit/Manifest b/dev-util/nvidia-cuda-toolkit/Manifest index 9fa2801165bf..5e0365c8a299 100644 --- a/dev-util/nvidia-cuda-toolkit/Manifest +++ b/dev-util/nvidia-cuda-toolkit/Manifest @@ -4,6 +4,7 @@ DIST cuda_10.1.168_418.67_linux.run 2526901749 BLAKE2B ed2207400730600c63895cc89 DIST cuda_10.1.243_418.87.00_linux.run 2572375299 BLAKE2B df9cb4faeeeeecc536e72697c6c73d544219f1b23cacb7fed646b0908fc7e573e85920861d56f76776ba637d84964cd1c789a0fe0d6541a4e0adf618b6c74d3c SHA512 f92b19d0242969a65a6e6db43bc293e442abc07a9e168c9e995692e1a401679504598c782e511be3879e1650b90f71a50bbc63c9ee45654c26b5007cdf33c4fe DIST cuda_10.2.89_440.33.01_linux.run 2645419389 BLAKE2B 236aa70a7b45e3636c2c229fffa7d1ca0699ab4365865a73edab607a209c42c2899133dd6a83c61c5929fa754668ad15aec4d847639af1c00a8e6657c8487c77 SHA512 ad8da539ff5df7caf411d1e497ff3d6978cfa8a1fd9150fa4846089e92a604ea56be8631f3efdfe7229a655b8d2d28e6edb32f5731530a77d6f00241cc7aab6e DIST cuda_11.0.3_450.51.06_linux.run 3112522594 BLAKE2B f458aeebee3f7145f46c5607d1743d350ed96e9b8fd824fd94d2c998bcd8ccf3ef924cf37e95ce002ba92f464edd5004164497e820084953613ec2deb6edb144 SHA512 e7014c868c0bf40c000b1fd14d156265773a399782937cc85a2b09cd62abddcacdc20b412e1cc91c3877d01563cf054b1e021f047b32cfff4ab516e7167382dd +DIST cuda_11.1.0_455.23.05_linux.run 3498245611 BLAKE2B 754d974acf309a0f2f969bb3312949aa5469b3ec6ebfc4a89f244420cecebc22dc19fb9f63ec7d5c177eeb533a8984cb6bfa8d271ba36d02aacce22d42442ba4 SHA512 b5d64f20dbb51f12c558be4a724c18ddcd6d18670036efb63d19bb8009300463b8051dd1a2d2d7768bf3076681954ea690af399651da832ba00867a3f4a9acdf DIST cuda_6.5.14_linux_32.run 76788277 BLAKE2B 75e79dce6cac5155bde8a3cafa945047c489b10272f8a3b94bf55d499df4b9c8b82506a81a20f9fd816bd4fd0514e515a6435399db1cb62b027c76490bd4dfae SHA512 89649ee0f4543b37037b7c8f5ed0b8bd502512afb4d93e3158b3df4786123be05a5288986b5abbfe15c14eb010777d2527b715225bea96a354a898c34e4a2fcc DIST cuda_6.5.14_linux_64.run 972320904 BLAKE2B 4a4361fb7a90989ec4b4aa433189e7b358e5a2272fb9b9c59429e0014ac14e3b8de1b247ee98dc30c3f3ee4cc009eca4fdd86027bd3b9527a683353d60bdf5c6 SHA512 fecca731b86955f5bc7b09d88b02951e3ee5d4b1f1cf5f92658227a029b87cd35d6ac22956a5fa0afe62dcdc57191f1d12bb08c9f7cc05128727cd8455947b1e DIST cuda_6.5.19_linux_32.run 81882112 BLAKE2B cf55ef7c969503c156431fc56301ed4e9a1234ae0cb867f12649636069f35e56bf6fc9df7482b6baade45d78c8baa2d98c41a28696da59294e0f575c4a0344ce SHA512 1ce9bd6b472b7e4f1fb181eb340dfcb757714d59a89aaa02146cfe1a97c8ccb7eb7699b4ec823276f277eb4d82d95050eaba17e7ed5fd2e47b9b5d78531c5d4e diff --git a/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.1.0.ebuild b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.1.0.ebuild new file mode 100644 index 000000000000..8f77d9e9c6eb --- /dev/null +++ b/dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.1.0.ebuild @@ -0,0 +1,228 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit check-reqs cuda toolchain-funcs unpacker + +DRIVER_PV="455.23.05" + +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" + +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}[X,uvm] + debugger? ( + dev-libs/openssl-compat:1.0.0 + sys-libs/libtermcap-compat + sys-libs/ncurses-compat:5[tinfo] + ) + vis-profiler? ( + dev-libs/openssl-compat:1.0.0 + >=virtual/jre-1.6 + )" + +S="${WORKDIR}" + +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() { + local cuda_supported_gcc + + # ATTENTION: change requires revbump + cuda_supported_gcc="4.7 4.8 4.9 5.3 5.4 6.3 6.4 7.2 7.3 8.2 8.3 8.4 9.2 9.3 10.2" + + 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}" + dodir ${cudadir} + into ${cudadir} + + # Install standard sub packages + local builddirs=( + builds/cuda_{cudart,cuobjdump,memcheck,nvcc,nvdisasm,nvml_dev,nvprune,nvrtc,nvtx} + 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 + for d in "${builddirs[@]}"; do + ebegin "Installing ${d}" + [[ -d ${d} ]] || die "Directory does not exist: ${d}" + + if [[ -d ${d}/bin ]]; then + local f + 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 + exeinto ${cudadir}/nvvm/bin + doexe builds/cuda_nvcc/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/Sanitizer + # special handling for the executable + exeinto ${cudadir}/Sanitizer + doexe builds/cuda_sanitizer_api/Sanitizer/compute-sanitizer + eend + fi + + if use vis-profiler; then + ebegin "Installing libnvvp" + doins -r builds/cuda_nvvp/libnvvp + # special handling for the executable + exeinto ${cudadir}/libnvvp + doexe builds/cuda_nvvp/libnvvp/nvvp + eend + 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} + + exeinto ${cudadir}/${ncu_dir} + doexe builds/${ncu_dir}/{ncu,ncu-ui,nv-nsight-cu,nv-nsight-cu-cli} + + exeinto ${cudadir}/${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64 + doexe builds/${ncu_dir}/host/linux-desktop-glibc_2_11_3-x64/{ncu-ui,ncu-ui.bin,CrashReporter} + 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} + exeinto ${cudadir}/${nsys_dir}/target-linux-x64 + doexe builds/${nsys_dir}/target-linux-x64/nsys + + exeinto ${cudadir}/${nsys_dir}/host-linux-x64 + doexe builds/${nsys_dir}/host-linux-x64/{nsight-sys,nsight-sys.bin,nsys-ui,CrashReporter,ImportNvtxt,QdstrmImporter,ResolveSymbols} + dobin builds/integration/nsight-systems/{nsight-sys,nsys,nsys-exporter,nsys-ui} + eend + # 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$(usex vis-profiler ":${ecudadir}/libnvvp" "") + ROOTPATH=${ecudadir}/bin + LDPATH=${ecudadir}/lib64:${ecudadir}/nvvm/lib64$(usex profiler ":${ecudadir}/extras/CUPTI/lib64" "") + EOF + + # Cuda prepackages libraries, don't revdep-build on them + insinto /etc/revdep-rebuild + newins - 80${PN} <<-EOF + SEARCH_DIRS_MASK="${ecudadir}" + EOF + # TODO: Find a better way to add +x permission to installed executables + # 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 +} |