mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-06 00:48:18 -07:00
dev-util/nvidia-cuda-toolkit: add 11.5.1
* fixes issues with glibc 2.34: https://forums.developer.nvidia.com/t/cuda-11-5-samples-throw-multiple-error-attribute-malloc-does-not-take-arguments/192750 Signed-off-by: David Seifert <soap@gentoo.org>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
DIST cuda_10.2.89_440.33.01_linux.run 2645419389 BLAKE2B 236aa70a7b45e3636c2c229fffa7d1ca0699ab4365865a73edab607a209c42c2899133dd6a83c61c5929fa754668ad15aec4d847639af1c00a8e6657c8487c77 SHA512 ad8da539ff5df7caf411d1e497ff3d6978cfa8a1fd9150fa4846089e92a604ea56be8631f3efdfe7229a655b8d2d28e6edb32f5731530a77d6f00241cc7aab6e
|
||||
DIST cuda_11.4.2_470.57.02_linux.run 3833993301 BLAKE2B b12710da9f31e3255f31dd6b0dab8545463983a4cd1c4432bea027d4e5cc4d1ad9183e09b70ac4ea19c7d3e959df0d19bb41ea896d726e877fd3917a3045a9a4 SHA512 50c80141bfe458aa7216173d9d548f25ade03c68fff59ffe63f842773e5afba7635fb8fd79eda416507e1e88b5fe28b39ac8bdc66b168c73a72995824af5c689
|
||||
DIST cuda_11.5.0_495.29.05_linux.run 3392192516 BLAKE2B f23587ff49e3fb247b3d7f6959695079955531503b202b4a93d907f81a8598ee01d44060cf60df0b0099d7f53d8025acf9e0d1766fb79639eb1b049f30919973 SHA512 577127699e8f91892f29b58b959cc15ed48dd96940184cc23970efdf419671a8232b5f291d39cb1721f465d59539eeb1c9a3d528acfd776fa8387ba235fea2e7
|
||||
DIST cuda_11.5.1_495.29.05_linux.run 3420998120 BLAKE2B 0d3f9626f97c60291397ebd0edc04e2c84942473d943d95af6fae244e5809721335bb90eaa6c019c9391de516d20599ca5631e99764616b6d25eacf1899d99d9 SHA512 71fb354714cac09265b5102223f919e34e3a8503593dd4f2e7b9542ae7787de96d64c490276b36b685da9e691cc2704419b67cfa376dcd3647e4d0f93b02db9b
|
||||
|
||||
257
dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.5.1.ebuild
Normal file
257
dev-util/nvidia-cuda-toolkit/nvidia-cuda-toolkit-11.5.1.ebuild
Normal file
@@ -0,0 +1,257 @@
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit check-reqs toolchain-funcs unpacker
|
||||
|
||||
DRIVER_PV="495.29.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"
|
||||
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-12_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.4 9.5 10.3 10.4 11.1 11.2 11.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}/ncu
|
||||
${ncu_dir}/ncu-ui
|
||||
${ncu_dir}/nv-nsight-cu
|
||||
${ncu_dir}/nv-nsight-cu-cli
|
||||
${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/OpenGLVersionChecker
|
||||
${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
|
||||
}
|
||||
Reference in New Issue
Block a user