diff options
Diffstat (limited to 'system/nvidia-driver')
-rw-r--r-- | system/nvidia-driver/README | 64 | ||||
-rw-r--r-- | system/nvidia-driver/changelog.txt | 1 | ||||
-rw-r--r-- | system/nvidia-driver/doinst.sh | 1 | ||||
-rw-r--r-- | system/nvidia-driver/nvidia-driver.SlackBuild | 308 | ||||
-rw-r--r-- | system/nvidia-driver/nvidia-driver.info | 50 | ||||
-rw-r--r-- | system/nvidia-driver/nvidia-switch | 214 |
6 files changed, 471 insertions, 167 deletions
diff --git a/system/nvidia-driver/README b/system/nvidia-driver/README index 5222c31dbddc7..e44212da199b8 100644 --- a/system/nvidia-driver/README +++ b/system/nvidia-driver/README @@ -1,18 +1,13 @@ This is the proprietary binary video driver from NVidia for the X.Org -X-server. This package does not include the kernel module - it is a part +X-server. This package does not include the kernel-module - it is a part of the nvidia-kernel package at SlackBuilds.org. Installing the 32-bit compatibility libraries is available: if desired, do: COMPAT32="yes" ./nvidia-driver.SlackBuild - -This script installs the new GLVND versions of the libraries by default. If -this causes compatibility issues, you can switch back to the legacy -non-GLVND versions with: - GLVND="no" ./nvidia-driver.SlackBuild -Several useful utilities are included: nvidia-xconfig, nvidia-smi, -nvidia-settings, etc. Please refer to the Nvidia documentation and man -pages for details and usage. +Several useful utilities are included: nvidia-xsettings, nvidia-smi, and +nvidia-settings. Please refer to the Nvidia documentation and man pages +for details and usage. For CUDA/OpenCL to work after reboot, you might need to include the following line in your /etc/rc.d/rc.local: @@ -21,23 +16,34 @@ following line in your /etc/rc.d/rc.local: /usr/bin/nvidia-modprobe -c 0 -u ------------->8--------------- -Due to the current complexity of the driver, it is currently no longer possible to -automate restoring the open source files. Here are the affected files: - - /usr/lib[64]/libGL.la - /usr/lib[64]/libGL.so.1 - /usr/lib[64]/libGL.so.1.0.0 - /usr/lib[64]/libGLESv1_CM.la - /usr/lib[64]/libGLESv1_CM.so - /usr/lib[64]/libGLESv1_CM.so.1 - /usr/lib[64]/libGLESv2.so - /usr/lib[64]/libGLESv2.so.2 - /usr/lib[64]/libEGL.so - /usr/lib[64]/libEGL.so.1 - /usr/lib[64]/xorg/modules/libwfb.so - /usr/lib[64]/xorg/modules/extensions/libglx.so - /usr/lib[64]/xorg/modules/extensions/libglx.la - -The simplest way, for now, to get all the files and symlinks into the right -place is to use pkgtools or slackpkg to reinstall the original mesa and -xorg-server packages *after* uninstalling this nvidia package. +Since this nvidia-driver conflicts with some files of xorg, it's a bit +complex to install/uninstall the driver. However, installation of the +nvidia-driver package itself backs up the conflicting files and puts +the nvidia-specific files into place. + +Included is a script called nvidia-switch, which is used to switch from +the xorg driver to the nvidia driver, but it will not edit xorg.conf +for you; you have to do that manually. The nvidia-switch script is +installed to /usr/sbin. NOTE: Although nvidia-switch is aware of a +COMPAT32 environment, its use therein is not supported. + +Usage of nvidia-switch: + nvidia-switch --install <--> install the nvidia files and save the + stock xorg files. + nvidia-switch --remove <--> remove the nvidia files and symlinks and + restore the stock xorg files. + +You do NOT have to run nvidia-switch after installing the package. + +Before uninstalling or upgrading this package, it is important that +you execute 'nvidia-switch --remove', which will switch back to the +stock xorg files and remove all links created by nvidia-switch during +installation. If you forget to do this, you might have to do the switch +manually, since 'nvidia-switch --install' may fail, resulting in xorg +not working. Here are the affected files: + + /usr/lib[64]/libGL.so.1.2 + /usr/lib[64]/xorg/modules/extensions/{libglx.so libglx.la} + +Simply remove the dead nvidia symlinks and rename the saved '-xorg' +appended files. diff --git a/system/nvidia-driver/changelog.txt b/system/nvidia-driver/changelog.txt index 032a90ecc5bbb..9bfbd1d96c3ae 100644 --- a/system/nvidia-driver/changelog.txt +++ b/system/nvidia-driver/changelog.txt @@ -27,4 +27,3 @@ 4.5a 26-MAR-2016 fixed broken symlinks 4.6 24-APR-2016 version update LLB, fix symlinks, added to version if multilib 4.7 31-APR-2016 version update LLB, added nvidia-installer, updated libs/symlinks -5.0 02-JAN-2017 version update LLB, refactored to use nvidia-installer, remove nvidia-switch diff --git a/system/nvidia-driver/doinst.sh b/system/nvidia-driver/doinst.sh index 861309858a7a8..8ee62f049edb4 100644 --- a/system/nvidia-driver/doinst.sh +++ b/system/nvidia-driver/doinst.sh @@ -2,4 +2,5 @@ if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications fi +./usr/sbin/nvidia-switch --install diff --git a/system/nvidia-driver/nvidia-driver.SlackBuild b/system/nvidia-driver/nvidia-driver.SlackBuild index adc5f96fcc10f..2040c422e8df0 100644 --- a/system/nvidia-driver/nvidia-driver.SlackBuild +++ b/system/nvidia-driver/nvidia-driver.SlackBuild @@ -3,7 +3,7 @@ # Slackware build script for nvidia-driver # Copyright 2007-2011 Heinz Wiesinger, Amsterdam, The Netherlands -# Copyright 2012-2017 Edward W. Koenig, Vancouver, WA, USA +# Copyright 2012-2016 Edward W. Koenig, Vancouver, WA, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -26,18 +26,18 @@ # see changelog.txt PRGNAM=nvidia-driver -VERSION=${VERSION:-375.26} +VERSION=${VERSION:-367.44} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} - -GLVND=${GLVND:-yes} -# Note: YMMV +CPROXY=${CPROXY:-yes} +GLVND=${GLVND:-no} # change at your peril ;-) +# Note: libglvnd may land in X.org Mesa set -e if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i586 ;; + i?86) ARCH=i486 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -48,16 +48,14 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" TARGET="x86" LIBDIRSUFFIX="" - COMPAT32=no elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" TARGET="x86" LIBDIRSUFFIX="" - COMPAT32=no elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" TARGET="x86_64" @@ -67,25 +65,12 @@ elif [ "$ARCH" = "x86_64" ]; then else SLKCFLAGS="-O2" LIBDIRSUFFIX="" - COMPAT32=${COMPAT32:-no} fi SRCNAM=NVIDIA-Linux-$TARGET-${VERSION} -# 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,sbin} \ - $PKG/usr/share/{applications,nvidia,pixmaps} \ - $PKG/usr/include/GL $PKG/etc/vulkan/icd.d $PKG/etc/X11/xorg.conf.d \ - $PKG/etc/X11/glvnd/egl_vendor.d -if [ "$COMPAT32" = "yes" ]; then - mkdir -p $PKG/usr/lib -fi - -# Extract all the sources +mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf nvidia-installer-$VERSION tar xvf $CWD/nvidia-installer-$VERSION.tar.bz2 @@ -97,6 +82,7 @@ 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 +rm -rf $SRCNAM sh $CWD/$SRCNAM.run --extract-only cd $SRCNAM chown -R root:root . @@ -106,7 +92,162 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/{drivers,extensions} \ + $PKG/etc/OpenCL/vendors/ $PKG/usr/lib$LIBDIRSUFFIX/tls \ + $PKG/usr/{bin,man/man1,sbin} $PKG/usr/share/{applications,pixmaps} \ + $PKG/usr/include/GL $PKG/etc/vulcan/ic.d/ + +# Main driver +install -m 755 nvidia_drv.so $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/drivers/ +install -m 755 libGL.la $PKG/usr/lib$LIBDIRSUFFIX/libGL.la-nvidia +if [ "$GLVND" = "no" ]; then +# The non-GLVND GLX client libraries are the default + install -m 755 libGL.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +else +# GLVND libGL libraries for future consideration, conflict with non-GLVND versions + install -m 755 libGL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/libGL.so.1.0.0-nvidia +fi + +# EGL requires the non-conflicting GLVND libs +install -m 755 libGLX.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libGLX_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libOpenGL.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libGLdispatch.so.0 $PKG/usr/lib$LIBDIRSUFFIX/ + +# we'll try leaving these in to get EGL which needs GLVND (see README.txt) +install -m 755 libEGL.so.1 $PKG/usr/lib$LIBDIRSUFFIX/libEGL.so.1-nvidia +install -m 755 libEGL_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libGLESv1_CM.so.1 $PKG/usr/lib$LIBDIRSUFFIX/libGLESv1_CM.so.1-nvidia +install -m 755 libGLESv2.so.2 $PKG/usr/lib$LIBDIRSUFFIX/libGLESv2.so.2-nvidia +install -m 755 libGLESv1_CM_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libGLESv2_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ + +# common libs +install -m 755 libOpenCL.so.1.0.0 $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libcuda.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libglx.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/xorg/modules/extensions/libglx.so.$VERSION-nvidia +install -m 755 libnvcuvid.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-cfg.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-compiler.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-eglcore.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-egl-wayland.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-encode.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-fatbinaryloader.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-fbc.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-glcore.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-glsi.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-ifr.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-ml.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-opencl.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-ptxjitcompiler.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-tls.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX +install -m 755 tls/libnvidia-tls.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/tls/ +install -m 755 libvdpau_nvidia.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ + +# For nvidia-settings GUI support +install -m 755 libnvidia-gtk2.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ +install -m 755 libnvidia-gtk3.so.$VERSION $PKG/usr/lib$LIBDIRSUFFIX/ + +#ICDs +install -m 644 nvidia.icd $PKG/etc/OpenCL/vendors/ +install -m 644 nvidia_icd.json $PKG/etc/vulcan/ic.d/ + +# Add optional 32-bit support +if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then + mkdir -p $PKG/usr/lib/tls + install -m 755 32/libGL.la $PKG/usr/lib/libGL.la-nvidia + + if [ "$GLVND" = "no" ]; then +# The non-GLVND GLX client libraries are the default + install -m 755 32/libGL.so.$VERSION $PKG/usr/lib/ + else +# GLVND libGL libraries for future consideration, conflict with non-GLVND versions + install -m 755 32/libGL.so.1.0.0 $PKG/usr/lib/libGL.so.1.0.0-nvidia + fi + +# EGL requires the non-conflicting GLVND libs + install -m 755 32/libGLX_nvidia.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libOpenGL.so.0 $PKG/usr/lib/ + install -m 755 32/libGLdispatch.so.0 $PKG/usr/lib/ + install -m 755 32/libGLX.so.0 $PKG/usr/lib/ + + +# we'll try leaving these in to get EGL etc support that needs GLVND (see README.txt) + install -m 755 32/libEGL.so.1 $PKG/usr/lib/libEGL.so.1-nvidia + install -m 755 32/libEGL_nvidia.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libGLESv1_CM.so.1 $PKG/usr/lib/libGLESv1_CM.so.1-nvidia + install -m 755 32/libGLESv2.so.2 $PKG/usr/lib/libGLESv2.so.2-nvidia + install -m 755 32/libGLESv1_CM_nvidia.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libGLESv2_nvidia.so.$VERSION $PKG/usr/lib/ +# Common libs + install -m 755 32/libOpenCL.so.1.0.0 $PKG/usr/lib/ + install -m 755 32/libcuda.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvcuvid.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-compiler.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-eglcore.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-encode.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-fatbinaryloader.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-glcore.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-fbc.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-glsi.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-ifr.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-ml.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-opencl.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-ptxjitcompiler.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libvdpau_nvidia.so.$VERSION $PKG/usr/lib/ + install -m 755 32/libnvidia-tls.so.$VERSION $PKG/usr/lib + install -m 755 32/tls/libnvidia-tls.so.$VERSION $PKG/usr/lib/tls/ +fi + +# symlinks; see also 'nvidia-switch' +cd $PKG/usr/lib$LIBDIRSUFFIX + ln -sf libcuda.so.$VERSION libcuda.so + ln -sf libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so + ln -sf libGLX_nvidia.so.$VERSION libGLX_nvidia.so.0 + ln -sf libOpenGL.so.0 libOpenGL.so + ln -sf libEGL_nvidia.so.$VERSION libEGL_nvidia.so.0 + ln -sf libGLESv1_CM_nvidia.so.$VERSION libGLESv1_CM_nvidia.so.1 + ln -sf libGLESv2_nvidia.so.$VERSION libGLESv2_nvidia.so.2 + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so +cd - +cd $PKG/usr/lib$LIBDIRSUFFIX/tls + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so +cd - + +# symlinks for optional 32-bit support +if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then + cd $PKG/usr/lib + ln -sf libcuda.so.$VERSION libcuda.so + ln -sf libvdpau_nvidia.so.$VERSION libvdpau_nvidia.so + ln -sf libGLX_nvidia.so.$VERSION libGLX_nvidia.so.0 + ln -sf libOpenGL.so.0 libOpenGL.so + ln -sf libEGL_nvidia.so.$VERSION libEGL_nvidia.so.0 + ln -sf libGLESv1_CM_nvidia.so.$VERSION libGLESv1_CM_nvidia.so.1 + ln -sf libGLESv2_nvidia.so.$VERSION libGLESv2_nvidia.so.2 + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so + cd - + cd $PKG/usr/lib$LIBDIRSUFFIX/tls + ln -sf libnvidia-tls.so.$VERSION libnvidia-tls.so + cd - +fi + +# Next come the apps +for i in nvidia-smi nvidia-bug-report.sh nvidia-debugdump; do + install -m 755 $i $PKG/usr/bin/ +done + +install -m 644 nvidia-smi.1.gz $PKG/usr/man/man1/ + +# New CUDA MPS server for 64-bit Linux only, and requires a device that supports +# Unified Virtual Address (UVA) and CUDA 4.0+. See NVIDIA docs. +if [ "$ARCH" = "x86_64" -a "${CPROXY}" = "yes" ]; then + install -m 755 nvidia-cuda-mps-control $PKG/usr/bin/ + install -m 755 nvidia-cuda-mps-server $PKG/usr/bin/ + install -m 644 nvidia-cuda-mps-control.1.gz $PKG/usr/man/man1/ +fi + # Compiling nvidia-installer from source +# Not really needed for this SBo package...yet! cd $TMP/nvidia-installer-$VERSION chown -R root:root . find -L . \ @@ -143,9 +284,8 @@ cd $TMP/nvidia-settings-$VERSION 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/ -cd - +cd ../ -# Compiling the various open source apps instead of using the precompiled binaries # Compiling nvidia-xconfig from source cd $TMP/nvidia-xconfig-$VERSION chown -R root:root . @@ -162,7 +302,7 @@ cd $TMP/nvidia-xconfig-$VERSION 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 +# Some new optional "useless" utilities, such as laptop GPU switching # nvidia-modprobe needed to create device nodes, see README! # FIXME: Needs cleanup at a later date. @@ -195,109 +335,53 @@ cd - install -m 644 _out/Linux_$TARGET/nvidia-persistenced.1.gz $PKG/usr/man/man1/ cd - -# Now we need to copy these newly compiled binaries to the driver source tree -# since we can't stop the installer from installing the precompiled ones -mv -f $PKG/usr/bin/nvidia-* $TMP/$SRCNAM - -# Next we need to backup the Mesa and Xorg-server files since nvidia-installer -# is too stupid! -# FIXME: Files are backed up cryptically to /var/lib/nvidia/ -# so I'll fix this later. - -# Configure options -if [ "$GLVND" = "yes" ]; then - GLVNDOPT="--install-libglvnd --glvnd-glx-client --glvnd-egl-client" +# 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 "on the fly" is no longer supported. +install -m 0755 $CWD/nvidia-switch $PKG/usr/sbin/ +sed -i s/PKGVERSION/$VERSION/g $PKG/usr/sbin/nvidia-switch +sed -i s/LIBDIRSUFFIX/$LIBDIRSUFFIX/g $PKG/usr/sbin/nvidia-switch +if [ ${COMPAT32} = "yes" ]; then + sed -i s/LIB32FLAG/yes/g $PKG/usr/sbin/nvidia-switch else - GLVNDOPT="--no-install-libglvnd --no-glvnd-glx-client --no-glvnd-egl-client" + sed -i s/LIB32FLAG/no/g $PKG/usr/sbin/nvidia-switch fi -if [ "$ARCH" = "x86_64" ]; then - if [ "${COMPAT32}" = "yes" ]; then - COMP32="--install-compat32-libs --compat32-prefix=$PKG/usr " - else - COMP32="--no-install-compat32-libs" - fi -else - COMP32="" -fi - -# First need to save libwfb from getting stomped on - no idea why... -cp -a /usr/lib$LIBDIRSUFFIX/xorg/modules/libwfb.so \ - /usr/lib$LIBDIRSUFFIX/xorg/modules/libwfb.so-xorg - - -# Install the binary libs using nvidia-installer compiles above -cd $TMP/$SRCNAM -./nvidia-installer -s -N --no-kernel-module -z -n --no-rpms \ - --no-distro-scripts --no-kernel-module --no-kernel-module-source \ - --force-libglx-indirect \ - --x-prefix=$PKG/usr \ - --x-module-path=$PKG/usr/lib64/xorg/modules \ - --x-library-path=$PKG/usr/lib64 \ - --x-sysconfig-path=$PKG/etc/X11/xorg.conf.d \ - --opengl-prefix=$PKG/usr \ - --utility-prefix=$PKG/usr \ - --documentation-prefix=$PKG/usr \ - --application-profile-path=$PKG/usr/share/nvidia \ - --glvnd-egl-config-path=$PKG/etc/X11/glvnd/egl_vendor.d \ - $GLVNDOPT \ - $COMP32 - -# Now dump Nvidia' wfb nonsense and restore (massive kludge). -rm -f $PKG/usr/lib64/xorg/modules/libnvidia-wfb.* -rm -f $PKG/usr/lib64/xorg/modules/libwfb.so -mv /usr/lib$LIBDIRSUFFIX/xorg/modules/libwfb.so-xorg \ - /usr/lib$LIBDIRSUFFIX/xorg/modules/libwfb.so - -# A lot of files disappear on the host after running the installer :o -# and a broken link gets in the filesystem: remove it -rm -f /usr/lib/libGL.so.1 - -# Save the installer back up files for later processing, if possible. -# note: if stock files have not been restored after an uninstall, these files will -# be nonsensical the next time this script is run. -cd /var/lib - tar cjf nvidia-archive-`date -I`.bz2 nvidia - rm -rf nvidia - mv /var/log/nvidia-installer.log /var/log/nvidia-installer-`date -I`.log -cd - # These update placeholders and correct wrong paths -sed -i "s|$TMP/package-$PRGNAM/usr/|/usr/|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la -sed -i "s|/usr/X11R6/lib|/usr/lib$LIBDIRSUFFIX/|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la -sed -i "s|$TMP/package-$PRGNAM/usr/bin/|/usr/bin/|" $PKG/usr/share/applications/nvidia-settings.desktop -sed -i "s|$TMP/package-$PRGNAM/usr/share/doc/NVIDIA_GLX-1.0/|/usr/share/pixmaps/|" \ +sed -i "s|__LIBGL_PATH__|/usr/lib$LIBDIRSUFFIX/|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la-nvidia +sed -i "s|/usr/X11R6/lib|/usr/lib$LIBDIRSUFFIX/|" $PKG/usr/lib$LIBDIRSUFFIX/libGL.la-nvidia +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__|Application;Settings;|" \ $PKG/usr/share/applications/nvidia-settings.desktop - if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then - sed -i "s|$TMP/package-$PRGNAM/usr/|/usr/lib/|" $PKG/usr/lib/libGL.la - sed -i "s|/usr/X11R6/lib|/usr/lib/|" $PKG/usr/lib/libGL.la + sed -i "s|__LIBGL_PATH__|/usr/lib/|" $PKG/usr/lib/libGL.la-nvidia + sed -i "s|/usr/X11R6/lib|/usr/lib/|" $PKG/usr/lib/libGL.la-nvidia fi -#ICDs -install -m 644 nvidia.icd $PKG/etc/OpenCL/vendors/ -install -m 644 nvidia_icd.json $PKG/etc/vulkan/icd.d/ - -# Remove xorg conf file since we take care of that in nvidia-driver -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 +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cd $TMP/$SRCNAM cp -a LICENSE NVIDIA_Changelog README.txt html $PKG/usr/doc/$PRGNAM-$VERSION +# sample start/stop scripts for nvidia-persistenced +cp -a nvidia-persistenced-init.tar.bz2 $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 +# configs, nvidia-settings application profile support (see documention for use). +mkdir -p $PKG/usr/share/nvidia +install -m 755 nvidia-application-profiles-$VERSION-key-documentation $PKG/usr/share/nvidia/ +install -m 755 nvidia-application-profiles-$VERSION-rc $PKG/usr/share/nvidia/ + +mkdir -p $PKG/install sed "s/PKGVERSION/$VERSION/g" $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh -# Flag install as multlib as needed and build package. cd $PKG MULTI="" if [ "$ARCH" = "x86_64" -a "${COMPAT32}" = "yes" ]; then MULTI="_multi" fi /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION$MULTI-$TARGET-$BUILD$TAG.${PKGTYPE:-tgz} - diff --git a/system/nvidia-driver/nvidia-driver.info b/system/nvidia-driver/nvidia-driver.info index badbb55c85fcc..f7c4d8bc510c9 100644 --- a/system/nvidia-driver/nvidia-driver.info +++ b/system/nvidia-driver/nvidia-driver.info @@ -1,30 +1,30 @@ PRGNAM="nvidia-driver" -VERSION="375.26" +VERSION="367.44" HOMEPAGE="http://www.nvidia.com" -DOWNLOAD="ftp://download.nvidia.com/XFree86/Linux-x86/375.26/NVIDIA-Linux-x86-375.26.run \ - ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-375.26.tar.bz2" -MD5SUM="b0706e88ad173f6b9c7bd2e5a838c163 \ - 9b947d02b174763291f8a42c915d04f6 \ - 1283efd13fe23498b3e9bb47048f9b59 \ - 846fed040276803b7651feec3d750bad \ - f630ddd768af0520436c54dabed285ab \ - f324b65f00b61f274d32862698de368f" -DOWNLOAD_x86_64="ftp://download.nvidia.com/XFree86/Linux-x86_64/375.26/NVIDIA-Linux-x86_64-375.26.run \ - ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-375.26.tar.bz2 \ - ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-375.26.tar.bz2" -MD5SUM_x86_64="d60819b2e377398c7296999ab5e7c1a4 \ - 9b947d02b174763291f8a42c915d04f6 \ - 1283efd13fe23498b3e9bb47048f9b59 \ - 846fed040276803b7651feec3d750bad \ - f630ddd768af0520436c54dabed285ab \ - f324b65f00b61f274d32862698de368f" +DOWNLOAD="ftp://download.nvidia.com/XFree86/Linux-x86/367.44/NVIDIA-Linux-x86-367.44.run \ + ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-367.44.tar.bz2" +MD5SUM="93ff8e1fe32939ca4fd6522b93825edc \ + f51a71ff7fcd4d5497ff0845f8cffe3a \ + d770941b0e0cd125edf2efdebbc1f1a0 \ + e30b2ff6481e188fcba57aa123c1584a \ + 2e729b8bf966d0f7239202a3f1ddf2c1 \ + aef95c4f92612770772140a11432c4d3" +DOWNLOAD_x86_64="ftp://download.nvidia.com/XFree86/Linux-x86_64/367.44/NVIDIA-Linux-x86_64-367.44.run \ + ftp://download.nvidia.com/XFree86/nvidia-installer/nvidia-installer-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-modprobe/nvidia-modprobe-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-persistenced/nvidia-persistenced-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-367.44.tar.bz2 \ + ftp://download.nvidia.com/XFree86/nvidia-xconfig/nvidia-xconfig-367.44.tar.bz2" +MD5SUM_x86_64="d34b42e64b25bf2a8d7b9a157723a3bd \ + f51a71ff7fcd4d5497ff0845f8cffe3a \ + d770941b0e0cd125edf2efdebbc1f1a0 \ + e30b2ff6481e188fcba57aa123c1584a \ + 2e729b8bf966d0f7239202a3f1ddf2c1 \ + aef95c4f92612770772140a11432c4d3" REQUIRES="nvidia-kernel" MAINTAINER="Edward W. Koenig" EMAIL="kingbeowulf@gmail.com" diff --git a/system/nvidia-driver/nvidia-switch b/system/nvidia-driver/nvidia-switch new file mode 100644 index 0000000000000..33d3f61d65d60 --- /dev/null +++ b/system/nvidia-driver/nvidia-switch @@ -0,0 +1,214 @@ +#!/bin/sh + +# Copyright 2012-2015 Edward W. Koenig, Vancouver, WA, 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. +# +# nvidia-switch utility 2.6 +# +# A tool to install and cleanly remove the nvidia driver without stomping on the xorg files. +# Note: this tool "should" allow switching on the fly, but why? Pick a driver! You will still +# need to edit a bunch of other config files. + +# TO-DO: needs more cleanup; still way too brittle. +# NOTE: non-GLVND ONLY!! + +ROOT="${ROOT:-/}" +CWD=$(pwd) +LIBSUFFIX="LIBDIRSUFFIX" # This will be replaced in the build script +COMPAT32="LIB32FLAG" # This will be replaced in the build script (yes | no) +INC="${ROOT}usr/include/GL" +LIB="${ROOT}usr/lib${LIBSUFFIX}" +LIB32="${ROOT}usr/lib" +XMOD="${LIB}/xorg/modules" +XLIB="$XMOD/extensions" +NV_VERSION="PKGVERSION" # This will be replaced in the build script +GL_VERSION="1.2.0" +NV_CONF="/usr/share/X11/xorg.conf.d/10-nvidia.conf" + +save_GL(){ + cd $2 + if [ "$1" = "nvidia" ]; then + mv libGL.so.$GL_VERSION libGL.so.$GL_VERSION-xorg + mv libGL.la libGL.la-xorg + mv libGL.la-nvidia libGL.la + ln -sf libGL.so.$NV_VERSION libGL.so.1 + ln -sf libGL.so.$NV_VERSION libGL.so + + mv libEGL.so.1.0.0 libEGL.so.1.0.0-xorg + mv libEGL.so.1-nvidia libEGL.so.1.0.0 + ln -sf libEGL.so.1.0.0 libEGL.so.1 + ln -sf libEGL.so.1.0.0 libEGL.so + + mv libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1.1.0-xorg + mv libGLESv1_CM.so.1-nvidia libGLESv1_CM.so.1.1.0 + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1 + + mv libGLESv2.so.2.0.0 libGLESv2.so.2.0.0-xorg + mv libGLESv2.so.2-nvidia libGLESv2.so.2.0.0 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so.2 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so + fi + + if [ "$1" = "xorg" ]; then + mv libGL.la libGL.la-nvidia + mv libGL.la-xorg libGL.la + mv libGL.so.$GL_VERSION-xorg libGL.so.$GL_VERSION + ln -sf libGL.so.$GL_VERSION libGL.so.1 + ln -sf libGL.so.$GL_VERSION libGL.so + + mv libEGL.so.1.0.0 libEGL.so.1-nvidia + mv libEGL.so.1.0.0-xorg libEGL.so.1.0.0 + ln -sf libEGL.so.1.0.0 libEGL.so.1 + ln -sf libEGL.so.1.0.0 libEGL.so + + mv libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1-nvidia + mv libGLESv1_CM.so.1.1.0-xorg libGLESv1_CM.so.1.1.0 + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so.1 + ln -sf libGLESv1_CM.so.1.1.0 libGLESv1_CM.so + + mv libGLESv2.so.2.0.0 libGLESv2.so.2-nvidia + mv libGLESv2.so.2.0.0-xorg libGLESv2.so.2.0.0 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so.2 + ln -sf libGLESv2.so.2.0.0 libGLESv2.so + fi + cd "$CWD" +} + +save_glx(){ + cd "$XLIB" + if [ "$1" = "nvidia" ]; then + mv libglx.so libglx.so-xorg + mv libglx.so.$NV_VERSION-nvidia libglx.so.$NV_VERSION + ln -sf libglx.so.$NV_VERSION libglx.so + fi + if [ "$1" = "xorg" ]; then + mv libglx.so.$NV_VERSION libglx.so.$NV_VERSION-nvidia + rm -f libglx.so + mv libglx.so-xorg libglx.so + fi +cd "$CWD" +} + +nvidia_ldconfig(){ + /sbin/ldconfig + #Generate correct symink for that lib + /sbin/ldconfig -l $1 +} + +nvidia_install(){ + echo $'Installing to nvidia-driver files!\n' + echo "Make sure the nvidia driver is ENABLED in /etc/X11/xorg.conf" + echo "and in /etc/X11/xorg.conf.d." + echo "Otherwise, this may lead to improperly working drivers." + + save_glx "nvidia" + save_GL "nvidia" $LIB +# Check for multilib configuration + if [ "$COMPAT32" = "yes" ]; then + save_GL "nvidia" $LIB32 + fi +} + +nvidia_remove(){ + echo $'Returning to stock xorg files!\n' + echo "Make sure the nvidia driver is DISABLED in /usr/share/X11/xorg.conf.d" + echo "/etc/X11/xorg.conf and in /etc/X11/xorg.conf.d." + echo "Otherwise, this may lead to improperly working drivers." + + save_glx "xorg" + save_GL "xorg" $LIB + + # Kill dangling symlinks; + rm -f $LIB/libnvidia*.so.1 + rm -f $LIB/libvdpau_nvidia.so.1 + rm -f $LIB/libcuda.so.1 + +# Check for multilib configuration + if [ "$COMPAT32" = "yes" ]; then + save_GL "xorg" $LIB32 +# remove dangling symlinks + rm -f $LIB32/libnvidia*.so.1 + rm -f $LIB32/libvdpau_nvidia.so.1 + rm -f $LIB32/libcuda.so.1 + fi + + if [ -e $NV_CONF ]; then + echo "removing $NV_CONF: you will need to provide your own" + echo "or reinstall nvidia-driver." + rm -f $NV_CONF + fi +} + +restore(){ +# Attempts to reinstall damaged stock packages if something went wrong. +# Obviously, you will need to run this after '--remove' and before +# 'removepkg nvidia-driver'. +# User must: +# 1. remove any dangling symlinks and *-xorg, *-nvidia files in /usr/lib?/, +# and any other housekeeping tasks. +# 2. copy stock Slackware packages to /root/Slackware +# 3. be running STOCK Slackware-14.2 +# 4. realize that COMPAT32 is not supported ;-) + +if [ "$LIBSUFFIX" = "64" ]; then + ARCH="x86_64" +else + ARCH="x86" +fi + +PKGPATH="/root/Slackware" +MESA="mesa-11.2.2-$ARCH-1.txz" +MESA32="mesa-compat32-11.2.2-$ARCH-1compat32.txz" +XORG="xorg-1.18.3-$ARCH-2.txz" + +if [ -d $PKGPATH ]; then + if [ `find $PKGPATH -prune -empty -type d` ]; then + echo "Your $PKGPATH is empty!" + else + upgradepkg --reinstall $MESA $XORG + if [ "COMPAT32" = "yes" ]; then + upgradepkg --reinstall $MESA32 + fi + fi +else + echo "Please create $PKGPATH containing the appropriate packages" +fi +} + +usage(){ + echo "Usage:" + echo " --install Set up nvidia driver files (only during pkg install)" + echo " --remove Return to stock xorg files and remove all symlinks" + echo " --restore Reinstall stock Mesa and xorg-server [EXPERIMENTAL]" + echo " --help Show this help message" +} + +if [ "$1" = '--install' ]; then + nvidia_install +elif [ "$1" = '--remove' ]; then + nvidia_remove +elif [ "$1" = '--restore' ]; then + restore +elif [ "$1" = '--help' ]; then + usage +else + usage +fi |