Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions development/cudatoolkit_13/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CUDA Toolkit CUDA is NVIDIA's parallel computing architecture. It
enables dramatic increases in computing performance by harnessing the
power of the GPU.

NOTE:
- the binary file to download is 5.5 GB
- the temporary package file will need 7 GB
- the final package will be over 4 GB (7 GB when installed).
Be sure to have enough free space before building this.

By default, the available nsight components are not included in
the final package. They may be enabled by setting the NSIGHT
environment variable to yes when building the package e.g.
NSIGHT=yes bash cudatoolkit_13.SlackBuild

This is version 13, which should be installable together with
the default version 10.
You can activate it by sourcing /etc/profile.d/cuda-12.9.sh

NOTE:
This build is beta. CUDA is large and complicated,
suggestions welcome. If unsure, I suggest using the default
CUDA 10.
However, mpv and ffmpeg compile fine with this CUDA, and hardware
accelerated video decoding works.
182 changes: 182 additions & 0 deletions development/cudatoolkit_13/cudatoolkit_13.SlackBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
#!/bin/bash

# Slackware build script for CUDA Toolkit

# Copyright 2020 Giorgio Peron <giorgio.peron@gmail.com>, Belluno, Italy
# Copyright 2026 Christoph Willing Sydney, Australia
# All rights reserved.
#
# Version 13.1.1 (2026) based on Lockywolf's (lwf) earlier cudatoolkit_12.6
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=cudatoolkit_13
FILENAME=cuda
VERSION=${VERSION:-13.1.1}
DRIVER=${DRIVER:-590.48.01}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

if [ -z "$ARCH" ]; then
ARCH=$( uname -m )
fi

if [ "$ARCH" != "x86_64" ]; then
printf '%s' "$ARCH architecture is unsupported." 1>&2
exit 1
fi

if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

#CPREFIX=cuda-13.1
SHORT_VERSION=$(echo ${VERSION%.*})
CPREFIX=cuda-$SHORT_VERSION

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION

echo -n "Unpacking .run file ..."
sh $CWD/"${FILENAME}"_"${VERSION}"_"${DRIVER}"_linux.run --extract=$(readlink -f $PRGNAM-$VERSION)
echo
cd $PRGNAM-$VERSION

# Cleanup useless
find . -name cuda-uninstaller -delete
rm -r NVIDIA*.run bin
rm -r cuda_nsight
rm -r nsight_compute nsight_systems

# legal stuff
mkdir -p "$PKG"/usr/doc/"$PRGNAM"-"$VERSION"
mv EULA.txt version.json $PKG/usr/doc/$PRGNAM-$VERSION

# extras
mkdir -p "${PKG}"/opt/"${CPREFIX}"/extras
mv cuda_sanitizer_api/compute-sanitizer "${PKG}"/opt/"${CPREFIX}"/extras/compute-sanitizer
rmdir cuda_sanitizer_api
mkdir -p "${PKG}"/opt/"${CPREFIX}"/bin
ln -s ../Sanitizer/compute-sanitizer "${PKG}"/opt/"${CPREFIX}"/bin/compute-sanitizer
ln -s ../nvvm/bin/cicc "${PKG}"/opt/"${CPREFIX}"/bin/cicc

# cuda 13.1 includes almost no documentation
mkdir -p "$PKG"/usr/doc/"$PRGNAM"-"$VERSION"
mv cuda_documentation/{CUDA_Toolkit_Release_Notes.txt,DOCS,README} $PKG/usr/doc/$PRGNAM-$VERSION/
mv cuda_documentation/EULA.txt $PKG/usr/doc/$PRGNAM-$VERSION/EULA-doc.txt
mv cuda_documentation/tools/* $PKG/usr/doc/$PRGNAM-$VERSION/
rm -rf cuda_documentation

# main cuda
mkdir -p "${PKG}"/opt/"${CPREFIX}"
for component in *; do
cp -alr --force "$component"/* "${PKG}"/opt/"${CPREFIX}"/
rm -rf $component
done

mv "${PKG}"/opt/"${CPREFIX}"/extras/CUPTI/include/* "${PKG}"/opt/"${CPREFIX}"/include/
mv "${PKG}"/opt/"${CPREFIX}"/extras/CUPTI/lib64/* "${PKG}"/opt/"${CPREFIX}"/lib64/
rmdir "${PKG}"/opt/"${CPREFIX}"/extras/CUPTI/{include,lib64}
rm "${PKG}"/opt/"${CPREFIX}"/extras/CUPTI/doc/html/_static/scripts/nvidia-sphinx-theme.js
rm "${PKG}"/opt/"${CPREFIX}"/extras/compute-sanitizer/docs/_static/scripts/nvidia-sphinx-theme.js
rm "${PKG}"/opt/"${CPREFIX}"/gds/cuobject/Doxyfile.in

rm "${PKG}"/opt/"${CPREFIX}"/include/include
rm "${PKG}"/opt/"${CPREFIX}"/lib64/lib64

# lwf: arch does this, not sure if this is needed.
# Add a symlink lib->lib64 as some libraries might expect that (FS#76951)
( cd "${PKG}"/opt/"${CPREFIX}" && ln -sr lib64 lib)

# lwf: arch does this, not sure if this is required
# Define compilers for CUDA to use.
# This allows us to use older versions of GCC if we have to.
ln -s /usr/bin/gcc-11.2.0 "${PKG}"/opt/"${CPREFIX}"/bin/gcc
ln -s /usr/bin/g++-gcc-11.2.0 "${PKG}"/opt/"${CPREFIX}"/bin/g++

# Fix Makefile paths to CUDA
for f in $(find "$PKG"/opt/"${CPREFIX}" -name Makefile); do
sed -i "s|/usr/local/cuda|/opt/${CPREFIX}|g" "$f"
done

# Ensure shared objects are executable
find $PKG -print0 | xargs -0 file | grep -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs chmod a+x 2> /dev/null || true

# Strip them
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true


# arch also does this.
# not sure if this is a must, and Slackware's g++ is even 11.2
# Allow newer compilers to work. This is not officially supported in the Arch package but
# if users want to try, let them try.
# See https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements
# for official requirements
sed -i "/.*unsupported GNU version.*/d" "${PKG}"/opt/"${CPREFIX}"/targets/x86_64-linux/include/crt/host_config.h
sed -i "/.*unsupported clang version.*/d" "${PKG}"/opt/"${CPREFIX}"/targets/x86_64-linux/include/crt/host_config.h

# Fix Makefile paths to CUDA
for f in $(find "${PKG}"/opt/"${CPREFIX}" -name Makefile); do
sed -i "s|/usr/local/cuda|/opt/${CPREFIX}|g" "$f"
done

# Put man in the standard place
mv $PKG/opt/"${CPREFIX}"/gds/man $PKG/usr/
find $PKG/usr/man -type f -exec gzip -9 {} \;
rm -rf $PKG/opt/"${CPREFIX}"/gds/usr
rm -rf $PKG/opt/"${CPREFIX}"/gds-tools

# Put docs in the standard place
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv "$PKG"/opt/"${CPREFIX}"/usr/share/doc/* "$PKG"/usr/doc/"$PRGNAM"-"$VERSION"/
rm -rf "$PKG"/opt/"${CPREFIX}"/usr/share
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Install profile and ld.so.config files
install -Dm755 "${CWD}/profile/cuda.sh" "${PKG}/etc/profile.d/$CPREFIX.sh"
install -Dm755 "${CWD}/profile/cuda.csh" "${PKG}/etc/profile.d/$CPREFIX.csh"
sed -i "s|@VERSION@|$SHORT_VERSION|g" "${PKG}/etc/profile.d/$CPREFIX.sh" "${PKG}/etc/profile.d/$CPREFIX.csh"

# Install pkgconfig
mkdir -p "$PKG"/opt/"${CPREFIX}"/lib64/pkgconfig/
cp "$CWD"/pkgconfig/*.pc "$PKG"/opt/"${CPREFIX}"/lib64/pkgconfig/
sed -i "s|Version: 11.0|Version: $SHORT_VERSION|g" "$PKG"/opt/"${CPREFIX}"/lib64/pkgconfig/*
sed -i "s|cudaroot=/opt/cuda|cudaroot=/opt/$CPREFIX|g" "$PKG"/opt/"${CPREFIX}"/lib64/pkgconfig/*

mkdir -p "$PKG"/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh


cd $PKG
/sbin/makepkg -l y -c n --compress -1 $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
10 changes: 10 additions & 0 deletions development/cudatoolkit_13/cudatoolkit_13.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PRGNAM="cudatoolkit_13"
VERSION="13.1.1"
HOMEPAGE="https://developer.nvidia.com/cuda-toolkit"
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
DOWNLOAD_x86_64="https://developer.download.nvidia.com/compute/cuda/13.1.1/local_installers/cuda_13.1.1_590.48.01_linux.run"
MD5SUM_x86_64="8aa93a77cffa8d055db0ceb9d0e2d692"
REQUIRES="nvidia-driver"
MAINTAINER="Christoph Willing"
EMAIL="chris.willing@linux.com"
10 changes: 10 additions & 0 deletions development/cudatoolkit_13/doinst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi

if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

12 changes: 12 additions & 0 deletions development/cudatoolkit_13/dotdesktop/nsight.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=Nsight Eclipse Edition
GenericName=Nsight Eclipse Edition
Icon=/usr/share/cuda/libnsight/icon.xpm
Exec=/usr/share/cuda/bin/nsight
TryExec=/usr/share/cuda/bin/nsight
Keywords=cuda;gpu;nvidia;debugger;
X-AppInstall-Keywords=cuda;gpu;nvidia;debugger;
X-GNOME-Keywords=cuda;gpu;nvidia;debugger;
Terminal=false
Categories=Development;IDE;Debugger;ParallelComputing
12 changes: 12 additions & 0 deletions development/cudatoolkit_13/dotdesktop/nvvp.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
Name=NVIDIA Visual Profiler
GenericName=NVIDIA Visual Profiler
Icon=/usr/share/cuda/libnvvp/icon.xpm
Exec=/usr/share/cuda/bin/nvvp
TryExec=/usr/share/cuda/bin/nvvp
Keywords=nvvp;cuda;gpu;nsight;
X-AppInstall-Keywords=nvvp;cuda;gpu;nsight;
X-GNOME-Keywords=nvvp;cuda;gpu;nsight;
Terminal=false
Categories=Development;Profiling;ParallelComputing
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/accinj64.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: accinj64
Description: OpenACC 64-bit Injection Library
Version: 11.0
Libs: -L${libdir} -laccinj64
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cublas.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cublas
Description: CUDA BLAS Library
Version: 11.0
Libs: -L${libdir} -lcublas
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cuda.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cuda
Description: CUDA Driver Library
Version: 11.0
Libs: -L${libdir} -lcuda
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cudart.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cudart
Description: CUDA Runtime Library
Version: 11.0
Libs: -L${libdir} -lcudart
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cufft.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cufft
Description: CUDA Fast Fourier Transform
Version: 11.0
Libs: -L${libdir} -lcufft
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cufftw.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cufftw
Description: CUDA Fast Fourier Transform Wide
Version: 11.0
Libs: -L${libdir} -lcufftw
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cuinj64.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cuinj64
Description: CUDA 64-bit Injection Library
Version: 11.0
Libs: -L${libdir} -lcuinj64
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/curand.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: curand
Description: CUDA Random Number Generation Library
Version: 11.0
Libs: -L${libdir} -lcurand
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cusolver.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cusolver
Description: A LAPACK-like library on dense and sparse linear algebra
Version: 11.0
Libs: -L${libdir} -lcusolver
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/cusparse.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: cusparse
Description: CUDA Sparse Matrix Library
Version: 11.0
Libs: -L${libdir} -lcusparse
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/nppc.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: nppc
Description: NVIDIA Performance Primitives - Core
Version: 11.0
Libs: -L${libdir} -lnppc
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/nppi.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: nppi
Description: NVIDIA Performance Primitives - Image Processing
Version: 11.0
Libs: -L${libdir} -lnppi
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/nppial.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: nppial
Description: NVIDIA Performance Primitives - Image Processing - Arithmetic and Logic
Version: 11.0
Libs: -L${libdir} -lnppial
Cflags: -I${includedir}
9 changes: 9 additions & 0 deletions development/cudatoolkit_13/pkgconfig/nppicc.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cudaroot=/opt/cuda
libdir=${cudaroot}/targets/x86_64-linux/lib
includedir=${cudaroot}/targets/x86_64-linux/include

Name: nppicc
Description: NVIDIA Performance Primitives - Image Processing - Color Conversion
Version: 11.0
Libs: -L${libdir} -lnppicc
Cflags: -I${includedir}
Loading