From 311c1aecbe3b447e01f558b337e87c87d30d3033 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Wed, 29 Mar 2017 15:31:20 +0200 Subject: [PATCH] Improve NVIDIA tools for auto-configuration (#9) * nvidiactl: Strip trailing spaces * nvidiactl: Remove blank line at end of file * nvidiactl: Load nvidia-drm Linux kernel module From `nvidia-drm-outputclass.conf` shipped by the NVIDIA Installer. > This xorg.conf.d configuration snippet configures the X server to > automatically load the nvidia X driver when it detects a device driven > by the nvidia-drm.ko kernel module. Please note that this only works > on Linux kernels version 3.9 or higher with CONFIG_DRM enabled, and > only if the nvidia-drm.ko kernel module is loaded before the X server > is started. Therefore load that Linux Kernel module so that the configuration works automatically. From Aaron Plattner in #nvidia@irc.freenode.net: > 16:31 < aaronp> PaulePanter, by default, nvidia-drm.ko provides the X > auto-load behavior and also assists in wiring up PRIME > configurations to the integrated GPU's display. > 16:31 < aaronp> If you load it with the 'modeset=1' parameter, then it > provides a complete drm driver that can be used by drm/eglstream > clients such as mutter or patched versions of weston. --- nvidiactl/nvidia.service | 1 - nvidiactl/nvidiactl | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nvidiactl/nvidia.service b/nvidiactl/nvidia.service index 873398a..ad00f90 100644 --- a/nvidiactl/nvidia.service +++ b/nvidiactl/nvidia.service @@ -10,4 +10,3 @@ StandardOutput=syslog [Install] WantedBy=graphical.target multi-user.target - diff --git a/nvidiactl/nvidiactl b/nvidiactl/nvidiactl index b54059c..5398b34 100755 --- a/nvidiactl/nvidiactl +++ b/nvidiactl/nvidiactl @@ -21,7 +21,7 @@ pciids="${PCIIDHINT_DIR}/${kver}-${nvver} ${PCIIDHINT_DIR}/${nvver}" leglvl="current" -for leglvlhint in ${pciids} ; do +for leglvlhint in ${pciids} ; do if [ -h "${leglvlhint}" ] ; then leglvl=$(readlink ${leglvlhint}) break @@ -66,10 +66,11 @@ if [ ! -z $N ]; then if [ -e ${leglink}/nvidia-uvm.ko ]; then insmod ${leglink}/nvidia-uvm.ko D=`grep nvidia-uvm /proc/devices | awk '{print $1}'` - if [ ! -z $D ]; then + if [ ! -z $D ]; then mknod -m 666 /dev/nvidia-uvm c $D 0 fi fi test -e ${leglink}/nvidia-modeset.ko && insmod ${leglink}/nvidia-modeset.ko + test -e ${leglink}/nvidia-drm.ko && insmod ${leglink}/nvidia-drm.ko fi exit 0