aboutsummaryrefslogtreecommitdiff
path: root/system/nvidia-driver
diff options
context:
space:
mode:
Diffstat (limited to 'system/nvidia-driver')
-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 d56d2733cdc3c..ac48e8d9dd73c 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 9b0abc2c738a8..38e8937cdee20 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 48d12a7d5dc85..c6baba6ce021f 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 0554fa733557c..c97fef3b3acd2 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