4

on a fresh Arch Linux installation i had difficulties with the graphics drivers. In the process i have installed a lot of different drivers to somehow get the display working.

Now i need to determine which driver X is using. How to do that?

The installed packages include xf86-video-intel, xf86-video-nouveau, nvidia, xorg-drivers. To solve a strange issue to launch any graphical desktop manager i had to replace nividia-libgl with mesa-libgl.

Graphics: Intel HD Graphics 4000 / Nvidia GT 750M

The content of Xorg.0.log is: http://pastebin.com/YwiMZmG6

Thanks in advance :)

4

You can check the Xorg startup log file, usually /var/log/Xorg.0.log and look at which modules it is loading. By default Xorg can try to autodetect but you can manually force a driver by putting a Device stanza in an Xorg conf file. Here is what the Xorg startup log will look like for an nvidia card and the nvidia proprietary driver.

[  3702.470] (II) xfree86: Adding drm device (/dev/dri/card0)
[  3702.472] (--) PCI:*(0:3:0:0) 10de:1184:3842:3774 rev 161, Mem @ 0xfa000000/16777216, 0xd8000000/134217728, 0xd6000000/33554432, I/O @ 0x0000cc00/128, BIOS @ 0x????????/524288
[  3702.472] (II) LoadModule: "glx"
[  3702.473] (II) Loading /usr/lib64/opengl/nvidia/extensions/libglx.so
[  3702.476] (II) Module glx: vendor="NVIDIA Corporation"
[  3702.476]    compiled for 4.0.2, module version = 1.0.0
[  3702.476]    Module class: X.Org Server Extension
[  3702.476] (II) NVIDIA GLX Module  355.11  Wed Aug 26 16:02:11 PDT 2015
[  3702.476] (II) LoadModule: "nvidia"
[  3702.476] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so
[  3702.476] (II) Module nvidia: vendor="NVIDIA Corporation"
[  3702.476]    compiled for 4.0.2, module version = 1.0.0
[  3702.476]    Module class: X.Org Video Driver
[  3702.476] (II) NVIDIA dlloader X Driver  355.11  Wed Aug 26 15:38:55 PDT 2015
[  3702.476] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[  3702.476] (++) using VT number 7
  • Thank you. In my original post i uploaded the file. It does not contain any "Nvidia" and it does not contain "nouveau" either. Could you take a look and tell me which driver i am loading? – Alex Dec 7 '15 at 20:21
  • @Alex look for similar lines in your log. Your logfile is very clearly identifying that it is loading the intel drivers. – casey Dec 7 '15 at 20:29
  • Looking at the log is not that helpful, as Xorg can load (and unload) multiple drivers while probing the hardware. – fwyzard Jun 29 '18 at 7:22
2

Here's an attempt to automatize the analysis of the log:

#!/bin/bash

if [ -z "$1" ]; then
    logfile=/var/log/Xorg.0.log
else
    logfile="$1"
fi

sed -n 's@.* Loading .*/\(.*\)_drv.so@\1@p' "$logfile" |
    while read driver; do
        if ! grep -q "Unloading $driver" "$logfile"; then
            echo $driver
            break
        fi
    done

Any ideas how to make it simpler are welcome. Ideally I'd like to have a direct solution — by a query to Xorg instead of parsing its logs.

2

One solution that I have found is to check what drivers are actually loaded while X is running. On my system, the drivers are installed under

  • /usr/lib/xorg/modules/drivers/
  • /usr/lib/x86_64-linux-gnu/nvidia/xorg/

so I can check what is currently loaded with

sudo lsof +D /usr/lib/xorg/modules/drivers/ +D /usr/lib/x86_64-linux-gnu/nvidia/xorg/

Right now I get

COMMAND  PID USER  FD   TYPE DEVICE SIZE/OFF   NODE NAME
Xorg    4473 root mem    REG  253,0    90360 536108 /usr/lib/xorg/modules/drivers/modesetting_drv.so

so I guess I'm using the modesetting driver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.