You are not logged in.

#1 2018-01-08 05:04:05

Veril
Member
Registered: 2018-01-08
Posts: 4

[SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

When I disable SG (switchable graphics) in the bios lspci cannot find the Nvidia card at all. So I assume it gets completely disabled. I was hoping it would remain as a dedicated PCI component that can be interacted with.

I'm looking for a way to set things up (install nvidia driver & config) with SG off such that when I switch it on arch will not use it for anything to do with graphics. If nvidia-smi works then the driver is communicating with the card properly.

Do I need to blacklist something? And how should I configure X? The Nvidia and Optimus wiki pages do not appear to cover this scenario unless I overlooked something.

Last edited by Veril (2018-01-13 19:28:27)

Offline

#2 2018-01-08 08:05:34

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

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

Set up a bumblebee setup, the bumblebee configuration will ensure that the nvidia card isn't automatically used (or NoExtract /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf and /usr/share/X11/xorg.conf.d/99-nvidia.conf and load the module manually), see https://wiki.archlinux.org/index.php/Bu … _Bumblebee as well.

Offline

#3 2018-01-13 01:30:07

Veril
Member
Registered: 2018-01-08
Posts: 4

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

There doesn't seem to be any way to just get by using bbswitch alone. Even though the wiki says you can.
I added bbswitch to auto load and blacklisted nouveau and nvidia but the blacklist is ignored, probably because xorg loads them.
When I try to have xorg load modesetting I get a black screen with a blinking "_".

I tried using
Section "Module"
Load "modesetting"
EndSection

Section "Device"
Identifier "Intel Graphics"
Driver "modesetting"
EndSection

and just

Section "Device"
Identifier "Intel Graphics"
Driver "modesetting"
EndSection

there is no nvidia conf in there.

As for bbswitch it seems to start good, but then it gets overridden by something - perhaps nvidia gets loaded and forces it back on?

after boot (x is using nvidia with all the nasty screen tearing it entails):
dmesg | grep bbswitch   
[   54.287398] bbswitch: loading out-of-tree module taints kernel.
[   54.287576] bbswitch: version 0.8
[   54.287581] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[   54.287587] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.PEGP
[   54.287681] bbswitch: detected an Optimus _DSM function
[   54.287738] bbswitch: disabling discrete graphics
[   54.393335] bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is off

yet

cat /proc/acpi/bbswitch 
0000:01:00.0 ON

and

sudo tee /proc/acpi/bbswitch <<<OFF
OFF
cat /proc/acpi/bbswitch 
0000:01:00.0 ON

dmesg | grep bbswitch   
...
[  212.729247] bbswitch: device 0000:01:00.0 is in use by driver 'nvidia', refusing OFF


When I disable the dgpu in bios arch seems happy to use intel yet when I enable it, it can't help but use nvidia even though it's blacklisted. can someone help?

Last edited by Veril (2018-01-13 01:32:58)

Offline

#4 2018-01-13 03:25:02

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

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

Are you on gnome? They do have their own logic which tries to provide switchable GPU support which does have the effects you describe, afaik there's no official way to alter that behaviour, however since I don't actively use gnome my sources might be off on that one.

Other potential candidates are /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf where you might want to comment the nvidia section for testing purposes.

Last edited by V1del (2018-01-13 03:27:48)

Offline

#5 2018-01-13 04:08:05

Veril
Member
Registered: 2018-01-08
Posts: 4

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

cinnamon

I ended up giving up on the whole approach and just started using the dgpu. nvidia-drm.modeset=1 seems to have eliminated tearing at the small price of input lag though it's hard to tell anyway, have to grab a window and start dragging around to feel something is off.

This if the process I went through, and tell me if I missed something. The wiki seems to suggest I need to hook pacman and do some other things but I'm not sure which or if they are needed:


sudo gedit /etc/X11/xorg.conf


Section "Module"
    Load "modesetting"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "1:0:0"
    Option "AllowEmptyInitialConfiguration"
EndSection


gedit ~/.xinitrc

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto



sudo gedit /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia-drm.modeset=1 ..."

sudo grub-mkconfig -o /boot/grub/grub.cfg

Last edited by Veril (2018-01-13 19:30:10)

Offline

#6 2018-01-13 12:54:37

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

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

Yeah that's all you have to do, the wiki tells you to add them to mkinitcpio.conf for early initialization, that isn't actually needed however, adding it as a kernel parameter is sufficient.

If you consider this [SOLVED] that way please edit your intiial post's title and prepend it (remove a few other words if the title gets too long), And for future posts, please wrap command output/file contents in [ code ] tags for improved readability.

Offline

#7 2018-01-13 20:41:46

Veril
Member
Registered: 2018-01-08
Posts: 4

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

V1del wrote:

Yeah that's all you have to do, the wiki tells you to add them to mkinitcpio.conf for early initialization, that isn't actually needed however, adding it as a kernel parameter is sufficient.

If you consider this [SOLVED] that way please edit your intiial post's title and prepend it (remove a few other words if the title gets too long), And for future posts, please wrap command output/file contents in [ code ] tags for improved readability.

out of curiosity I just deleted xorg.conf and ~/.xinitrc and I saw no difference whatsoever. So rolling with just nvidia-drm.modeset=1 alone.

are they default or redundant? I'm confused.

Offline

#8 2018-01-13 23:52:46

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

Re: [SOLVED] Laptop Nvidia Optimus - use dGPU only for compute

Afaik the .xinitrc is usually necessary (though my info on that might be dated, how do you log in/start X?), the relevant parts of the xorg conf are handled by the file in /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf already.

Offline

Board footer

Powered by FluxBB