You are not logged in.

#1 2020-01-26 22:00:08

CoreCat
Member
Registered: 2017-02-05
Posts: 23

[Solved] Intel + Nvidia graphics Optimus

Hi,

I just installed xorg-server and the proprietary nvidia driver on my laptop.
When only xorg was installed, and I ran 'startx', an X session successfully started and the default xterms where displayed.
After installing the nvidia drivers, I was not able to start an X session with 'startx'.
So I looked in 'Xorg.0.log' and found the warning:

(WW) NVIDIA(0): Unable to get display device for DPI computation.

Afterwards I installed optimus-manager, did 'optimus-manager --switch nvidia', and everything was fine again.
Now I don't understand why it didn't work before without using optimus-manager.

I have a desktop pc with a similar specs on which I also use Arch.
So both my pc and laptop use an nvidia card that needs the standard nvidia drivers, and have intel integrated graphics on the CPU.

My laptop:

$ lspci | grep VGA
0:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
$ lspci | grep -i 3d
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)

My desktop:

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] (rev a1)

When I first installed xorg on my deskop, I used the vga port of my motherboard, and it worked fine.
After installing my new nvidia card, and installing the nvidia drivers, xorg gave a black screen (if I recall correctly), which I had to kill in another tty.
I found out that I could fix this by using the vga port of my nvidia graphics card instead the vga port of my motherboard.

So currently I'm glad that xorg seems to work fine, but I would like to know why I needed to use optimus-manager on my laptop, and not my desktop.

To summarize:

Desktop + intel drivers VGA port motherboard =  OK
Desktop + nvidia drivers + VGA port motherboard = NOK (black screen, I think)
Desktop + nvidia drivers + VGA port nvidia card = OK
Laptop + intel drivers = OK
Laptop + nvidia driver = NOK (Xorg startup messages, and then screen freezes)

Could someone please tell me what happened?
Why was switching to my nvidia card with optimus the solution, while my desktop pc used my nvidia card just by installing the nvidia driver?
I don't really understand how the output is directed to different VGA ports, depending on the graphics card that is used.
Where can I read up on this?

Last edited by CoreCat (2020-01-28 20:17:34)

Offline

#2 2020-01-26 22:15:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: [Solved] Intel + Nvidia graphics Optimus

Offline

#3 2020-01-27 21:11:13

CoreCat
Member
Registered: 2017-02-05
Posts: 23

Re: [Solved] Intel + Nvidia graphics Optimus

seth wrote:

Thanks for the reply, but I can't find the answer I need there.

Note: By default, optimus-manager only changes which graphics driver is active; it does not automatically turn off the NVIDIA GPU when not in use. To enable power management, see the upstream guide. Configurations that include a Turing architecture (or newer) GPU and an Intel Coffee Lake (or newer) CPU can use power management features built into the proprietary NVIDIA driver; see [6] for setup instructions.

-> Why did I need to use optimus-manager to tell my laptop to use my nvidia card while my pc did that automatically once I installed the nvidia drivers?

And what concepts am I missing that I should google?
Any suggestions?

Offline

#4 2020-01-27 21:17:50

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,399

Re: [Solved] Intel + Nvidia graphics Optimus

https://en.wikipedia.org/wiki/Nvidia_Optimus

On this kind of setup your nvidia card is not plugged to any output. Everything is rendered by the integrated intel card. The things explained in that wiki linked by seth allow you to configure the system in a way so that the nvidia card gets the actual information as to what should be rendered, this image produced by the nvidia card is then transferred to the intel card which in turn shows it on your screen.

On the desktop the nvidia card can just directly render to the screen, you don't need to do the xorg config setup to tell the system to send information to nvidia, nvidia -> intel, intel -> output.

Offline

#5 2020-01-28 20:16:14

CoreCat
Member
Registered: 2017-02-05
Posts: 23

Re: [Solved] Intel + Nvidia graphics Optimus

V1del wrote:

https://en.wikipedia.org/wiki/Nvidia_Optimus

On this kind of setup your nvidia card is not plugged to any output. Everything is rendered by the integrated intel card. The things explained in that wiki linked by seth allow you to configure the system in a way so that the nvidia card gets the actual information as to what should be rendered, this image produced by the nvidia card is then transferred to the intel card which in turn shows it on your screen.

On the desktop the nvidia card can just directly render to the screen, you don't need to do the xorg config setup to tell the system to send information to nvidia, nvidia -> intel, intel -> output.

Hi V1del, thanks for explaining it to me.

I didn't get the fact that optimus was an nvidia technology.

I checked the differences in the config files.
In short it's like this:

Laptop (optimus)
>Device: intel
>Outputclass: nvidia
To me this seems to mean rather "use intel driver, and output to nvidia, which would be the other way around.

Desktop
>Device: nvidia

That anwers my questions, Ill mark it solved.
But if anyone knows any good sources except the Arch wiki or man pages, feel free to share.




Full configuration files in order

Laptop with optimus xorg.conf files:

/etc/X11/xorg.conf.d/10-optimus-manager.conf

Section "Device"
	Identifier "intel"
	Driver "modesetting"
	BusID "PCI:0:2:0"
	Option "DRI" "3"
EndSection

/usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

/usr/share/X11/xorg.conf.d/10-quirks.conf

# Collection of quirks and blacklist/whitelists for specific devices.


# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442 
Section "InputClass"
        Identifier "ThinkPad HDAPS accelerometer blacklist"
        MatchProduct "ThinkPad HDAPS accelerometer data"
        Option "Ignore" "on"
EndSection

# https://bugzilla.redhat.com/show_bug.cgi?id=523914
# Mouse does not move in PV Xen guest
# Explicitly tell evdev to not ignore the absolute axes.
Section "InputClass"
        Identifier "Xen Virtual Pointer axis blacklist"
        MatchProduct "Xen Virtual Pointer"
        Option "IgnoreAbsoluteAxes" "off"
        Option "IgnoreRelativeAxes" "off"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
        Identifier "Tag trackballs as XI_TRACKBALL"
        MatchProduct "trackball"
        MatchDriver "evdev"
        Option "TypeName" "TRACKBALL"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=62831
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
Section "InputClass"
        Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
        MatchProduct "La-VIEW Technology Naos 5000 Mouse"
        MatchDriver "evdev"
        Option "TypeName" "MOUSE"
EndSection

/usr/share/X11/xorg.conf.d/40-libinput.conf

# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
#   Identifier "something or other"
#   MatchDriver "libinput"
#
#   MatchIsTouchpad "on"
#   ... other Match directives ...
#   Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.

Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

destop xorg.conf file:

/etc/X11/xorg.conf.d/xorg.conf

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 435.21

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Offline

Board footer

Powered by FluxBB