diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/nvidia-legacy390-driver/README.nvidia-persistenced | 6 | ||||
-rw-r--r-- | system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild | 47 |
2 files changed, 35 insertions, 18 deletions
diff --git a/system/nvidia-legacy390-driver/README.nvidia-persistenced b/system/nvidia-legacy390-driver/README.nvidia-persistenced index 9b0abc2c738a8..38e8937cdee20 100644 --- a/system/nvidia-legacy390-driver/README.nvidia-persistenced +++ b/system/nvidia-legacy390-driver/README.nvidia-persistenced @@ -1,3 +1,9 @@ +The NVIDIA Persistence Daemon is a userspace daemon on Linux to support +persistence of driver state across Cuda job runs. The daemon targets all +current Tesla, Quadro and GRID GPUs. For further information, see + +https://docs.nvidia.com/deploy/driver-persistence/index.html + The driver now includes rc.nvidia-persistenced as an option. While it can be run as root, it is more secure to run it as an unpriveleged user, so we run it as user nvidia. diff --git a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild index 462e4f800a40f..b503dfb57fd09 100644 --- a/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild +++ b/system/nvidia-legacy390-driver/nvidia-legacy390-driver.SlackBuild @@ -99,8 +99,6 @@ rm -rf nvidia-xconfig-$VERSION tar xvf $CWD/nvidia-xconfig-$VERSION.tar.bz2 rm -rf nvidia-modprobe-$VERSION.tar.bz2 tar xvf $CWD/nvidia-modprobe-$VERSION.tar.bz2 -rm -rf nvidia-persistenced-$VERSION.tar.bz2 -tar xvf $CWD/nvidia-persistenced-$VERSION.tar.bz2 sh $CWD/$SRCNAM.run --extract-only cd $SRCNAM chown -R root:root . @@ -247,21 +245,6 @@ cd - install -m 644 _out/Linux_$TARGET/nvidia-modprobe.1.gz $PKG/usr/man/man1/ cd - -# 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/ - cd - - # Bash script to cleanly install (in doinst.sh) and uninstall the nvidia files # so we don't stomp on the overlapping xorg files. # Note: switching can be problematic ;-) @@ -373,8 +356,26 @@ else sed -i "s|@MULTILIB@||" $PKG/install/slack-desc fi +cat $CWD/doinst.sh > $PKG/install/doinst.sh + # Add rc.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/ + if ! getent group nvidia > /dev/null 2>&1; then echo "Creating the group nvidia:" groupadd -g 365 nvidia || exit 1 @@ -388,9 +389,19 @@ if [ "${PERSISTENCED:-no}" = "yes" ]; then mkdir -p $PKG/etc/rc.d 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 + cat <<EOF >> $PKG/install/doinst.sh +# Create group and user nvidia if they don't already exist +if ! getent group nvidia > /dev/null 2>&1; then + echo "Creating the group nvidia:" + groupadd -g 365 nvidia || exit 1 +fi +if ! getent passwd nvidia > /dev/null 2>&1; then + echo "Creating the user nvidia:" + useradd -u 365 -g 365 -c "Nvidia" -d /dev/null -s /bin/false nvidia || exit 1 fi -cat $CWD/doinst.sh > $PKG/install/doinst.sh +EOF +fi # Flag multlib as needed and build package. cd $PKG |