Skip to content

Commit

Permalink
Improve NVIDIA tools for auto-configuration (#9)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
pmenzel authored and donald committed Mar 29, 2017
1 parent 324e8fb commit 311c1ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion nvidiactl/nvidia.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ StandardOutput=syslog

[Install]
WantedBy=graphical.target multi-user.target

5 changes: 3 additions & 2 deletions nvidiactl/nvidiactl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 311c1ae

Please sign in to comment.