summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
author Lenard Spencer <lenardrspencer@gmail.com>2020-05-09 08:12:01 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2020-05-10 08:36:54 +0700
commitf36574e0285b3db04651d139c6439ae273a48e4c (patch)
tree0342ea0935b9e7430d1aa66a6dec58d0d10429a4 /system
parent9731445ce974510af1c2030d6719ba70c1f9ad52 (diff)
downloadslackbuilds-f36574e0285b3db04651d139c6439ae273a48e4c.tar.gz
slackbuilds-f36574e0285b3db04651d139c6439ae273a48e4c.tar.xz
system/nvidia-driver: Update script.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/nvidia-driver/README14
-rw-r--r--system/nvidia-driver/README.nvidia-persistenced6
-rw-r--r--system/nvidia-driver/nvidia-driver.SlackBuild57
-rw-r--r--system/nvidia-driver/nvidia-switch4
4 files changed, 50 insertions, 31 deletions
diff --git a/system/nvidia-driver/README b/system/nvidia-driver/README
index d56d2733cd..ac48e8d9dd 100644
--- a/system/nvidia-driver/README
+++ b/system/nvidia-driver/README
@@ -27,12 +27,14 @@ you might need to include the following line in your /etc/rc.d/rc.local:
/usr/bin/nvidia-modprobe -c 0 -u
Notes:
-1. You still need to blacklist the opensource nouveau driver. This is
- easily done by installing xf86-video-nouveau-blacklist-noarch-1.txz
- in extra/xf86-video-nouveau-blacklist on the distibution DVD.
-2. If nvidia-driver is already installed, there may be extraneous
- "unable to find installed file..." messages on the console and log.
- This is benign and due to the nvidia installer not being very smart.
+1. You still need to blacklist the open source nouveau driver. This is
+ easily done by installing xf86-video-nouveau-blacklist in
+ extra/xf86-video-nouveau-blacklist on the distibution DVD.
+
+2. If nvidia-driver is already installed, the script will abort with a
+ prompt to remove the existing driver (it is not necessary to remove
+ the kernel module).
+
3. On 14.2 ONLY, if you want to revert back to the open source drivers,
run 'nvidia-switch --remove' to restore the original libGL.la and
then 'removepkg nvidia-driver' "should" work in most cases. If not,
diff --git a/system/nvidia-driver/README.nvidia-persistenced b/system/nvidia-driver/README.nvidia-persistenced
index 9b0abc2c73..38e8937cde 100644
--- a/system/nvidia-driver/README.nvidia-persistenced
+++ b/system/nvidia-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-driver/nvidia-driver.SlackBuild b/system/nvidia-driver/nvidia-driver.SlackBuild
index 48d12a7d5d..c6baba6ce0 100644
--- a/system/nvidia-driver/nvidia-driver.SlackBuild
+++ b/system/nvidia-driver/nvidia-driver.SlackBuild
@@ -28,7 +28,7 @@
PRGNAM=nvidia-driver
VERSION=${VERSION:-440.82}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
CURRENT=${CURRENT:-no}
@@ -93,8 +93,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 .
@@ -162,7 +160,6 @@ cd $TMP/$SRCNAM
mv /etc/OpenCL/vendors/nvidia.icd $PKG/etc/OpenCL/vendors/nvidia.icd
mv /etc/vulkan/icd.d/nvidia_icd.json $PKG/etc/vulkan/icd.d/nvidia_icd.json
mv /etc/vulkan/implicit_layer.d/nvidia_layers.json $PKG/etc/vulkan/implicit_layer.d/nvidia_layers.json
-rm -rf /etc/vulkan
# In current, mesa now puts an entry into this directory, so we
# leave it alone if it is not empty
if [ -z "$(ls -A /etc/OpenCL/vendors)" ]; then
@@ -275,20 +272,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 -
-
# 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
@@ -314,8 +297,31 @@ else
sed -i "s|@MULTILIB@||" $PKG/install/slack-desc
fi
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+# 14.2 needs nvidia-switch, -current does not
+if [ "$CURRENT" = "no" ]; then
+ echo -e "usr/sbin/nvidia-switch --install\n" >> $PKG/install/doinst.sh
+fi
+
# 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
@@ -329,13 +335,18 @@ 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
-
-# 14.2 needs nvidia-switch, -current does not
-if [ "$CURRENT" = "no" ]; then
- echo -e "./usr/sbin/nvidia-switch --install\n" >> $PKG/install/doinst.sh
+EOF
fi
# Flag multlib as needed and build package.
diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch
index 0554fa7335..c97fef3b3a 100644
--- a/system/nvidia-driver/nvidia-switch
+++ b/system/nvidia-driver/nvidia-switch
@@ -43,7 +43,7 @@ LIB="${ROOT}usr/lib${LIBSUFFIX}"
LIB32="${ROOT}usr/lib"
save_GL(){
-# backup original mesa and xorg conflicts
+# backup original mesa conflict
cd $2
case "$1" in
"nvidia")
@@ -90,7 +90,7 @@ nvidia_remove(){
echo "and in /usr/share/X11/xorg.conf.d and /etc/X11/xorg.conf.d."
echo "(Removing nvidia-kernelis recommended to accomplish this.)"
echo "Otherwise, this may lead to improperly working drivers."
- echo -e "\nPlease run /sbin/ldconfing after removing nvidia-driver."
+ echo -e "\nPlease run /sbin/ldconfing after removing nvidia-driver.\n"
save_GL "xorg" $LIB
# Check for multilib configuration