Nothin' but Slackware

バイクとLinuxに戯れる日々

2025年02月

nvidia-driver 570.124.04 for Kernel-6.13.x

NVIDIA-Linux-x86_64-570.124.04.run was released.
This version is able to be installed against Kernel-6.13.x.

Here is a slackbuild which based on SBo's original script.
[Note] There is nothing special. We do not need any specific patches for kernel-6.13.

nvidia-driver.SlackBuild
[code]
#!/bin/bash

# Slackware build script for nvidia-driver

# Copyright 2012-2019 Edward W. Koenig, Vancouver, WA, US
# Copyright 2020-2024 Lenard Spencer, Orlando, FL, USA
#
# All rights reserved.
#
# 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=
nvidia-driver
VERSION=${VERSION:-
570.124.04}
BUILD=${BUILD:-1}
TAG=${TAG:-jw}
PKGTYPE=${PKGTYPE:-txz}

set -e

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

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

if [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  TARGET="x86_64"
  LIBDIRSUFFIX="64"
# Set 32-bit compatibility flag default
  COMPAT32=${COMPAT32:-no}
else
  echo "$ARCH is not supported."
  exit 1
fi

if [ "${COMPAT32}" = "yes" ]; then
    MULTI="_multilib"
else
    MULTI=""
fi

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

if [ "${PERSISTENCED:-no}" = "yes" ]; then
  # 20240715 bkw: this test was borked, fixed.
  if [ "$( getent group nvidia )" = "" -o "$( getent passwd nvidia )" = "" ]; then
    echo "User and/or group nvidia do not exist!"
    echo "Please create user and group nvidia and rerun this script."
    exit 1
  fi
fi

SRCNAM=NVIDIA-Linux-$TARGET-${VERSION}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}

# make a clean package directory tree
rm -rf $PKG
rm -rf $TMP/$SRCNAM
mkdir -p $TMP $PKG $OUTPUT $PKG/install
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/{drivers,extensions} \
  $PKG/etc/OpenCL/vendors/ $PKG/usr/{bin,doc,man/man1} \
  $PKG/usr/share/{applications,nvidia,pixmaps,egl/egl_external_platform.d} \
  $PKG/etc/X11/glvnd/egl_vendor.d $PKG/var/log

if [ "$COMPAT32" = "yes" ]; then
  mkdir -p $PKG/usr/lib/tls
fi

# Extract all the sources
cd $TMP
rm -rf nvidia-installer-$VERSION
tar xvf $CWD/nvidia-installer-$VERSION.tar.bz2
rm -rf nvidia-settings-$VERSION
tar xvf $CWD/nvidia-settings-$VERSION.tar.bz2
rm -rf nvidia-xconfig-$VERSION
tar xvf $CWD/nvidia-xconfig-$VERSION.tar.bz2
rm -rf nvidia-modprobe-$VERSION
tar xvf $CWD/nvidia-modprobe-$VERSION.tar.bz2
sh $CWD/$SRCNAM.run --extract-only
cd $SRCNAM
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# Compiling the various open source apps instead of using the precompiled binaries
# Compiling nvidia-installer from source

cd $TMP/nvidia-installer-$VERSION

# Install various files in $PKG instead of the root filesystem:
  sed -i "s|/etc/vulkan|$PKG/etc/vulkan|" files.c
  sed -i "s|/lib/firmware/nvidia|$PKG/lib/firmware/nvidia|" files.c
  sed -i "s|\"/etc\"|\"$PKG/etc\"|" nvidia-installer.h
  sed -i "s|/var/lib/nvidia|$PKG/var/lib/nvidia|" backup.c
  sed -i "s|/usr/lib/nvidia|$PKG/usr/lib/nvidia|" files.c
  sed -i "s|/usr/lib/nvidia|$PKG/usr/lib/nvidia|" misc.c

  chown -R root:root .
  find -L . \
   \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
    -o -perm 511 \) -exec chmod 755 {} \; -o \
   \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
    -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

  CFLAGS="$SLKCFLAGS" LDFLAGS="-lz" make $NUMJOBS

  install -m 755 _out/Linux_$TARGET/nvidia-installer $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-installer.1.gz $PKG/usr/man/man1/

cd -

# Now we need to copy the newly patched and compiled nvidia-installer
# to the driver source tree for use
mv -f $PKG/usr/bin/nvidia-installer $TMP/$SRCNAM
mv -f $PKG/usr/man/man1/nvidia-installer.1.gz $TMP/$SRCNAM

if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then
    COMP32="--install-compat32-libs --compat32-prefix=$PKG/usr"
else
    if [ ! "$ARCH" = "x86_64" ]; then
        COMP32=""
    else
        COMP32="--no-install-compat32-libs"
    fi
fi

# Install the binary libs using nvidia-installer compiled above
cd $TMP/$SRCNAM
./nvidia-installer -s --no-kernel-module --no-drm --no-unified-memory \
  -z -n -b --no-rpms --no-distro-scripts \
  --no-kernel-module-source --no-x-check --force-libglx-indirect \
  --x-prefix=$PKG/usr \
  --x-module-path=$PKG/usr/lib${LIBDIRSUFFIX}/xorg/modules \
  --x-library-path=$PKG/usr/lib${LIBDIRSUFFIX} \
  --x-sysconfig-path=$PKG/etc/X11/xorg.conf.d \
  --opengl-prefix=$PKG/usr \
  --utility-prefix=$PKG/usr \
  --utility-libdir=lib${LIBDIRSUFFIX} \
  --documentation-prefix=$PKG/usr \
  --application-profile-path=$PKG/usr/share/nvidia \
  --glvnd-egl-config-path=$PKG/etc/X11/glvnd/egl_vendor.d \
  --log-file-name=$PKG/var/log/nvidia-installer.log \
  --egl-external-platform-config-path=$PKG/usr/share/egl/egl_external_platform.d \
  --no-nvidia-modprobe \
  --no-install-libglvnd \
  --no-wine-files \
  --no-systemd \
  --no-peermem \
  $COMP32

# If we are using Wine, then:
if [ "${WINE:-no}" != "no" ]; then
  mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/nvidia/wine
  install -m 755 _nvngx.dll $PKG/usr/lib$LIBDIRSUFFIX/nvidia/wine
  install -m 755 nvngx.dll $PKG/usr/lib$LIBDIRSUFFIX/nvidia/wine
fi
# libOpenCL.so is now included in 15.0 (in ocl-icd),
# so we don't need this one.
rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libOpenCL.so*
if [ "${COMPAT32}" = "yes" ]; then
    rm -f $PKG/usr/lib/libOpenCL.so*
fi
# remove a pair of folders installed and used by nvidia-installer but
# no longer needed (caused the "failed to remove some directories"
# warning message):
rm -rf $PKG/usr/lib/nvidia || true
rm -rf $PKG/var/lib || true

# if not multilib, remove the unneeded /usr/lib folder:
if [ "${COMPAT32}" != "yes" ]; then
  rm -rf $PKG/usr/lib || true
fi

# Mitigate a bug in nvidia-installer that misplaces a symlink
# (Thanks to marco70 on LQ for catching this)
( cd $PKG/usr/lib${LIBDIRSUFFIX}/gbm
rm -f nvidia-drm_gbm.so
  ln -sf ../libnvidia-allocator.so.1 nvidia-drm_gbm.so
)
# Compile utilites from source, replacing the precompiled versions
#
# Compiling nvidia-settings
cd $TMP/nvidia-settings-$VERSION
  chown -R root:root .
  find -L . \
   \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
    -o -perm 511 \) -exec chmod 755 {} \; -o \
   \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
    -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

  cd src/libXNVCtrl
    make clean
    CFLAGS="$SLKCFLAGS" \
    make
  cd ../../

  CFLAGS="$SLKCFLAGS" \
  make

  install -m 755 src/_out/Linux_$TARGET/nvidia-settings $PKG/usr/bin/
  install -m 644 doc/_out/Linux_$TARGET/nvidia-settings.1.gz $PKG/usr/man/man1/
  install -m 644 doc/nvidia-settings.desktop $PKG/usr/share/applications/
  install -m 644 doc/nvidia-settings.png $PKG/usr/share/pixmaps/
# For nvidia-settings GUI support
  install -m 755 src/_out/Linux_$TARGET/libnvidia-gtk2.so $PKG/usr/lib$LIBDIRSUFFIX/libnvidia-gtk2.so.$VERSION
  install -m 755 src/_out/Linux_$TARGET/libnvidia-gtk3.so $PKG/usr/lib$LIBDIRSUFFIX/libnvidia-gtk3.so.$VERSION
cd -

# Compiling nvidia-xconfig
cd $TMP/nvidia-xconfig-$VERSION
  chown -R root:root .
  find -L . \
   \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
    -o -perm 511 \) -exec chmod 755 {} \; -o \
   \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
    -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

  CFLAGS="$SLKCFLAGS" \
  make

  install -m 755 _out/Linux_$TARGET/nvidia-xconfig $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-xconfig.1.gz $PKG/usr/man/man1/
cd -

# Some optional utilities, such as laptop for possible GPU switching and
# nvidia-modprobe needed to create device nodes

# Compiling nvidia-modprobe
  cd $TMP/nvidia-modprobe-$VERSION
    chown -R root:root .
    find -L . \
     \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
      -o -perm 511 \) -exec chmod 755 {} \; -o \
     \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
      -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

    CFLAGS="$SLKCFLAGS" make
# must be installed suid root for nvidia-persistenced to work properly
    install -m 4755 _out/Linux_$TARGET/nvidia-modprobe $PKG/usr/bin/
    install -m 644 _out/Linux_$TARGET/nvidia-modprobe.1.gz $PKG/usr/man/man1/
  cd -

# These update the paths in nvidia-settings.desktop
sed -i "s|__UTILS_PATH__|/usr/bin|" $PKG/usr/share/applications/nvidia-settings.desktop
sed -i "s|__PIXMAP_PATH__|/usr/share/pixmaps|" $PKG/usr/share/applications/nvidia-settings.desktop
sed -i "s|__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__|Settings;|" $PKG/usr/share/applications/nvidia-settings.desktop
# Remove depcrecated entry in nvidia-settings.desktop
sed -i '/Encoding/d' $PKG/usr/share/applications/nvidia-settings.desktop

# Remove xorg conf folder since we handle that in nvidia-kernel
rm -rf $PKG/etc/X11/xorg.conf.d

cd $TMP/$SRCNAM
# put docs in the right place
mv $PKG/usr/share/man/man1/nvidia-* $PKG/usr/man/man1
rm -rf $PKG/usr/share/man
mv $PKG/usr/share/doc/NVIDIA_GLX-1.0 $PKG/usr/doc/$PRGNAM-$VERSION
rm -rf $PKG/usr/share/doc
cp -a LICENSE NVIDIA_Changelog README.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.Slackware
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/fetch-sources.sh > $PKG/usr/doc/$PRGNAM-$VERSION/fetch-sources.sh

sed "s/PKGVERSION/$VERSION/g" $CWD/slack-desc > $PKG/install/slack-desc
if [ "$COMPAT32" = "yes" ]; then
   sed -i "s|nvidia-driver: @MULTILIB@|nvidia-driver: This package includes the 32-bit libraries.|" $PKG/install/slack-desc
else
   sed -i "s|nvidia-driver: @MULTILIB@|nvidia-driver:|" $PKG/install/slack-desc
fi

cat $CWD/doinst.sh > $PKG/install/doinst.sh

# Add nvidia-persistenced:
if [ "${PERSISTENCED:-no}" = "yes" ]; then
  cd $TMP
  rm -rf nvidia-persistenced-$VERSION.tar.bz2
  tar xvf $CWD/nvidia-persistenced-$VERSION.tar.bz2
# Compiling nvidia-persistenced
  cd $TMP/nvidia-persistenced-$VERSION
  chown -R root:root .
  find -L . \
   \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
    -o -perm 511 \) -exec chmod 755 {} \; -o \
   \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
    -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

  CFLAGS="$SLKCFLAGS" make
  install -m 755 _out/Linux_$TARGET/nvidia-persistenced $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-persistenced.1.gz $PKG/usr/man/man1/
# install rc.nvidia-perstistenced:
  mkdir -p $PKG/etc/rc.d $PKG/var/run/nvidia-persistenced
  install -m 755 $CWD/rc.nvidia-persistenced $PKG/etc/rc.d/rc.nvidia-persistenced
  sed -i "s|__USER__|nvidia|" $PKG/etc/rc.d/rc.nvidia-persistenced
  chown nvidia:nvidia $PKG/var/run/nvidia-persistenced
fi

# We must now remove our custom nvidia-installer as it will no longer
# work on an installed driver:
rm -f $PKG/usr/bin/nvidia-{installer,uninstall}

# Flag multilib as needed and build package.
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.$PKGTYPE


doinst.sh
[code]
# Add nvidia-persistenced:
if [ "${PERSISTENCED:-no}" = "yes" ]; then
  cd $TMP
  rm -rf nvidia-persistenced-$VERSION.tar.bz2
  tar xvf $CWD/nvidia-persistenced-$VERSION.tar.bz2
# Compiling nvidia-persistenced
  cd $TMP/nvidia-persistenced-$VERSION
  chown -R root:root .
  find -L . \
   \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
    -o -perm 511 \) -exec chmod 755 {} \; -o \
   \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
    -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

  CFLAGS="$SLKCFLAGS" make
  install -m 755 _out/Linux_$TARGET/nvidia-persistenced $PKG/usr/bin/
  install -m 644 _out/Linux_$TARGET/nvidia-persistenced.1.gz $PKG/usr/man/man1/
# install rc.nvidia-perstistenced:
  mkdir -p $PKG/etc/rc.d $PKG/var/run/nvidia-persistenced
  install -m 755 $CWD/rc.nvidia-persistenced $PKG/etc/rc.d/rc.nvidia-persistenced
  sed -i "s|__USER__|nvidia|" $PKG/etc/rc.d/rc.nvidia-persistenced
  chown nvidia:nvidia $PKG/var/run/nvidia-persistenced
fi

# We must now remove our custom nvidia-installer as it will no longer
# work on an installed driver:
rm -f $PKG/usr/bin/nvidia-{installer,uninstall}

# Flag multilib as needed and build package.
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.$PKGTYPE
root@jw-slackware:/usr/src/001_NVIDIA-kernel_and_drivers/02_nvidia-driver# cat doinst.sh
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications
fi

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


slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

             |-----handy-ruler------------------------------------------------------|
nvidia-driver: nvidia-driver (Proprietary Binary Nvidia Video Driver)
nvidia-driver:
nvidia-driver: This is the proprietary binary video driver from nvidia for
nvidia-driver: the x.org X server. This package does not include the kernel
nvidia-driver: module - it is included in the nvidia-kernel package.
nvidia-driver:
nvidia-driver: See /usr/doc/nvidia-driver-PKGVERSION/README.Slackware
nvidia-driver: for more information.
nvidia-driver:
nvidia-driver: https://www.nvidia.com
nvidia-driver:


nvidia-kernel.info
[code]
PRGNAM="nvidia-driver"
VERSION="
570.124.04"
HOMEPAGE="https://www.nvidia.com"
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
DOWNLOAD_x86_64="
https://download.nvidia.com/XFree86/Linux-x86_64/570.124.04/NVIDIA-Linux-x86_64-570.124.04.run \
                
https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-570.124.04.tar.bz2 \
                
https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-570.124.04.tar.bz2 \
                
https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-570.124.04.tar.bz2 \
                
https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-570.124.04.tar.bz2 \
                
https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-570.124.04.tar.bz2"
MD5SUM_x86_64="3db4c7546e72893e076fffcff2568329 \
               e552a6a70f555b347c8dd4dd259d8d8a \
               07d62f807e9592bd76ea179c9c8ae2eb \
               f9442f54d7a0ba19f46382430112e7b9 \
               2640bd2bf2bdfb32777ffb792a996158 \
               8c54afe6c29972949ec06554fff4babf"
REQUIRES="
nvidia-kernel"
MAINTAINER=""
EMAIL=""

fetch-sources.sh
[code]
#!/bin/sh

echo -n VERSION:
read VERSION

#wget https://download.nvidia.com/XFree86/Linux-x86_64/$VERSION/NVIDIA-Linux-x86_64-${VERSION}.run
wget https://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-${VERSION}.tar.bz2
wget https://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-${VERSION}.tar.bz2
wget https://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-${VERSION}.tar.bz2
wget https://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${VERSION}.tar.bz2
wget https://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-${VERSION}.tar.bz2

echo "...DONE!"





===


nvidia-kernel 570.124.04 for Kernel-6.13.x

NVIDIA-Linux-x86_64-570.124.04.run was released.
This version is able to be installed against Kernel-6.13.x.

Here is a slackbuild which based on SBo's original script.
[Note] There is nothing special. We do not need any specific patches for kernel-6.13.

nvidia-kernel.SlackBuild
[code]
#!/bin/bash

# Slackware build script for nvidia-kernel

# Copyright 2007-2011 Heinz Wiesinger, Amsterdam, The Netherlands
# Copyright 2012-2019 Edward W. Koenig, Vancouver, WA, USA
# Updates copyright 2020-2024 Lenard Spencer, Orlando, FL, USA
# All rights reserved.
#
# 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.

# Thanks to Robby Workman for suggestions to improve this script.

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

PRGNAM=
nvidia-kernel
VERSION=${VERSION:-
570.124.04}
BUILD=${BUILD:-1}
TAG=${TAG:-jw}
PKGTYPE=${PKGTYPE:-txz}

KERNEL=${KERNEL:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/${KERNEL}/build}

if [ "${OPEN:-yes}" = "yes" ]; then
  OPEN1="-open"
  OPEN2="_OPEN"
  DESC="OPEN"
else
  unset OPEN1
  unset OPEN2
  DESC="PROPRIETARY"
fi

set -e

PKGVER=${VERSION}${OPEN2}_$(echo $KERNEL | tr - _)

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "x86_64" ]; then
  TARGET="x86_64"
else
  echo "$ARCH is not supported."
  exit 1
fi

unset ARCH

SRCNAM=NVIDIA-Linux-$TARGET-${VERSION}

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

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

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
rm -rf $SRCNAM
sh $CWD/$SRCNAM.run --extract-only || exit 1
cd $SRCNAM || exit 1
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}

( cd kernel$OPEN1  || exit 1

# CC=${CC:-gcc} suppresses an otherwise harmless "compiler mismatch"
# message.  If you custom-build your kernel with clang,
# then pass CC=clang to this script.
  CC=${CC:-gcc} make ${NUMJOBS} SYSSRC=$KERNELPATH module || exit 1
)

mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/video
install -m 0664 kernel$OPEN1/nvidia.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel$OPEN1/nvidia-modeset.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel$OPEN1/nvidia-drm.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel$OPEN1/nvidia-uvm.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/

mkdir -p $PKG/usr/share/X11/xorg.conf.d/
cat $TMP/$SRCNAM/nvidia-drm-outputclass.conf > $PKG/usr/share/X11/xorg.conf.d/10-nvidia.conf

mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVER
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVER/$PRGNAM.SlackBuild

mkdir -p $PKG/install
sed "s%@DESC@%$DESC%" $CWD/slack-desc > $PKG/install/slack-desc
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$TARGET-$BUILD$TAG.$PKGTYPE


doinst.sh
[code]
chroot . /sbin/depmod -a @KERNEL@ 2>/dev/null


slack-desc
[code]
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':' except on otherwise blank lines.

             |-----handy-ruler------------------------------------------------------|
nvidia-kernel: nvidia-kernel (Kernel Interface for the nvidia driver)
nvidia-kernel:
nvidia-kernel: This is the @DESC@ version of the kernel module needed by the
nvidia-kernel: binary nvidia-driver.
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:
nvidia-kernel:


nvidia-kernel.info
[code]
PRGNAM="nvidia-kernel"
VERSION="
570.124.04"
HOMEPAGE="https://www.nvidia.com"
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
DOWNLOAD_x86_64="
https://download.nvidia.com/XFree86/Linux-x86_64/570.124.04/NVIDIA-Linux-x86_64-570.124.04.run"
MD5SUM_x86_64="3db4c7546e72893e076fffcff2568329"
REQUIRES=""
MAINTAINER=""



===


AMF-headers-1.4.35 for the latest FFmpeg Git

2025/02/02 slackware64-current公式に AMF-headers-1.4.35 パッケージが入ってきた。
Thanks to Patrick !

Patのパッケージソースは AMF-headers-v1.4.35.tar.gz であるため、自前の同パッケージも
同じソースからリビルドしたので、ここに記す。

また、最新FFmpeg.git 向けのパッチ  001_AV1_B-frame-support.patch を
ソース AMF-headers-v1.4.35.tar.gz 用に作り直した。

[ 背景 ]
FFmpeg7.xを " --enable-amf " 付きでコンパイルする場合、amf-headers がインストールされている
必要があるが、2025年1月19日現在のFFmpeg最新Gitをコンパイルすると、avcodec/amfenc の 
B-Frame support 関連でエラーになり、コンパイルに失敗する。

これを回避するには AMF-headers-1.4.35 に対策パッチをあてて更新する必要がある。
以下は、その AMF-headers-1.4.35 対策パッケージの詳細。


Here is a patch to AMF-headers-1.4.35

[code]  001_AV1_B-frame-support.patch
diff -Nru a/AMF/components/VideoEncoderAV1.h b/AMF/components/VideoEncoderAV1.h
--- a/AMF/components/VideoEncoderAV1.h    2024-12-30 22:01:35.454080599 +0900
+++ b/AMF/components/VideoEncoderAV1.h    2024-12-30 21:52:36.161034517 +0900
@@ -356,6 +356,7 @@
 #define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_TEMPORAL_LAYERS           L"Av1CapMaxNumTemporalLayers"       // amf_int64; default = N/A; The cap of maximum number of temporal layers
 #define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_LTR_FRAMES                L"Av1CapMaxNumLTRFrames"            // amf_int64; default = N/A; The cap of maximum number of LTR frames. This value is calculated based on current value of AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS.
 #define AMF_VIDEO_ENCODER_AV1_CAP_SUPPORT_TILE_OUTPUT               L"AV1SupportTileOutput"             // amf_bool; if tile output is supported
+#define AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES                           L"AV1BFrames"                       // amf_bool; if b frames are supported for AV1
 
 #define AMF_VIDEO_ENCODER_AV1_CAP_SUPPORT_SMART_ACCESS_VIDEO        L"Av1EncoderSupportSmartAccessVideo"    // amf_bool; returns true if system supports SmartAccess Video
 #define AMF_VIDEO_ENCODER_AV1_CAP_WIDTH_ALIGNMENT_FACTOR            L"Av1WidthAlignmentFactor"          // amf_int64; default = 1; The encoder capability for width alignment
@@ -363,4 +364,9 @@
 
 #define AMF_VIDEO_ENCODER_AV1_MULTI_HW_INSTANCE_ENCODE              L"Av1MultiHwInstanceEncode"             // amf_bool; flag to enable AV1 multi VCN encode.
 
+// properties for Picture Management (VCN5 feature)
+#define AMF_VIDEO_ENCODER_AV1_MAX_CONSECUTIVE_BPICTURES             L"Av1MaxConsecutiveBPictures"        // amf_int64; default 0 or 127, determined by AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES. Maximum number of consecutive B frames for B frame encoding
+#define AMF_VIDEO_ENCODER_AV1_B_PIC_PATTERN                         L"Av1BPicturesPattern"               // amf_int64; default 0. Number of B frames for B frame encoding
+#define AMF_VIDEO_ENCODER_AV1_ADAPTIVE_MINIGOP                      L"Av1AdaptiveMiniGop"                // amf_bool; default false. Adaptive miniGOP size for B frame encoding
+
 #endif //#ifndef AMF_VideoEncoderAV1_h


[code]  AMF-headers.info (source file)
PRGNAM="AMF-headers"
VERSION="1.4.35"
HOMEPAGE="https://github.com/GPUOpen-LibrariesAndSDKs/AMF"
DOWNLOAD="https://github.com/GPUOpen-LibrariesAndSDKs/AMF/releases/download/v1.4.35/AMF-headers-v1.4.35.tar.gz"
MD5SUM="ee23bff88cbdbc03ec1ff0b8a5f92da9"
DOWNLOAD_x86_64="direct download link(s) of application source tarball(s), x86_64 only"
MD5SUM_x86_64="MD5SUM_x86_64@"
REQUIRES="%README%"
MAINTAINER="JW(Shinichi Abe)"
EMAIL=""


[code]  AMF-headers.SlackBuild
#!/bin/bash

# Copyright 2025  Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# 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)

PKGNAM=AMF-headers
SRCDIR=amf-headers
SRCVER=${SRCVER:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
VERSION=$(echo $SRCVER | tr -d v)
BUILD=${BUILD:-2jw}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$(uname -m)" in
    i?86) ARCH=i686 ;;
    arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
    *) ARCH=$(uname -m) ;;
  esac
  export ARCH
fi

# This is a noarch package:
ARCH=noarch

# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
  exit 0
fi

TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM

rm -rf $PKG
mkdir -p $TMP $PKG

cd $TMP
rm -rf $SRCDIR-$SRCVER
tar xvf $CWD/$PKGNAM-$SRCVER.tar.?z || exit 1
cd $SRCDIR-$SRCVER || exit 1

# Add Interface for AV1 B-frame Support
patch -p1 < $CWD/001_AV1_B-frame-support.patch --verbose || exit 1


chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \+ -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \+

# Install header files into package:
mkdir -p $PKG/usr/include
cp -a * $PKG/usr/include

# Add a documentation directory:
mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
cp -a \
  $CWD/LICENSE.txt $CWD/README.md \
  $PKG/usr/doc/${PKGNAM}-$VERSION
# Copy slackbuild and patches
cp -a \
  $CWD/${PKGNAM}.SlackBuild $CWD/001_AV1_B-frame-support.patch \
  $PKG/usr/doc/${PKGNAM}-$VERSION

chown root:root $PKG/usr/doc/${PKGNAM}-$VERSION/*
chmod 644 $PKG/usr/doc/${PKGNAM}-$VERSION/*

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz

[code]  slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.

           |-----handy-ruler------------------------------------------------------|
AMF-headers: AMF-headers (Advanced Media Framework headers)
AMF-headers:
AMF-headers: AMF is a light-weight, portable multimedia framework that abstracts
AMF-headers: away most of the platform and API-specific details and allows for easy
AMF-headers: implementation of multimedia applications using a variety of
AMF-headers: technologies, such as DirectX 11, OpenGL, and OpenCL and facilitates
AMF-headers: an efficient interop between them. AMF targets AMD GPUs.
AMF-headers:
AMF-headers: Homepage: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/wiki
AMF-headers:
AMF-headers:



ギャラリー
  • deepl-clip.sh で簡単翻訳 [更新:2025-04-29]
  • Avidemux 2.8.2_20250323_7cf15b3
  • Avidemux 2.8.2_20250323_7cf15b3
  • Avidemux 2.8.x with Qt6 GUI
  • Avidemux 2.8.x with Qt6 GUI
  • MEGAcmd-2.0.0_Linux
  • gcolor3 with Japanese menu and LC_MESSAGES
  • avidemux2 TEST package from the latest git source (on jul.23.2024)
  • fcitx5-mozc-2.29.5135.102.1 (15jw) -- Added "merge-ut-dictionaries"