You are not logged in.

#1 2013-10-10 09:23:21

tjbp
Member
Registered: 2010-11-06
Posts: 43

Can I boot to a specific GPU?

My laptop has an Intel and an Nvidia chip. If I enable KMS for both (ie. I'm using the nouveau and i915 drivers, both of which support KMS when nomodeset isn't set), the Nvidia chip is always powered on and used first. Technically my laptop should support vgaswitcheroo, which is available in /sys, but the i915 driver currently has a bug that breaks this functionality.

I can set the kernel param nouveau.modeset=0, which allows me to boot up and use the i915 driver, but the Nvidia chip isn't switched off. This renders the exercise useless, since I'm ultimately trying to switch off the Nvidia chip to save power. I've tried acpi_call, but it fails to find anything to switch off.

I can use vgaswitcheroo to turn off GPUs, but it simply doesn't become available unless both drivers are started with KMS. Is there a way I can force a boot with i915, without turning off KMS for nouveau?

Last edited by tjbp (2013-10-18 14:27:30)

Offline

#2 2013-10-11 02:27:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Can I boot to a specific GPU?

Can you blacklist nouveau rather than just turning modesetting off? Would that make a difference? The other possibility might be to disable the discrete card in the firmware setup.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-10-14 00:11:02

tjbp
Member
Registered: 2010-11-06
Posts: 43

Re: Can I boot to a specific GPU?

cfr wrote:

Can you blacklist nouveau rather than just turning modesetting off? Would that make a difference? The other possibility might be to disable the discrete card in the firmware setup.

I believe KMS is by design loading nouveau (and possibly turning the chip on if it's not the firmware) long before a blacklisting would affect it. Either way, it doesn't work. As for firmware setup, unfortunately this is a Macbook and afaik it doesn't have that option. sad I've also unsuccessfully tried rebooting from OSX with only the Intel chip powered on, since apparently that has worked for some people in the past.

Offline

#4 2013-10-14 02:53:26

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Can I boot to a specific GPU?

I assume you have early KMS enabled for i915?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-10-14 15:49:29

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,967

Re: Can I boot to a specific GPU?

Blacklisting nouveau might work if you use 'KMS late start' for the nouveau driver.

make sure you have i915 in MODULES=  line in /etc/mkinitcpio.conf and remove any references to nouveau
(this will lead to a KMS early start for the intel card)
recreate initramfs

Blacklist nouveau
(this SHOULD prevent nouveau KMS late start).


Reboot and check


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#6 2013-10-16 09:52:06

tjbp
Member
Registered: 2010-11-06
Posts: 43

Re: Can I boot to a specific GPU?

i915 early KMS, nouveau early KMS and blacklisted = Nvidia chip on and i915 in use
i915 early KMS, nouveau late KMS and blacklisted = Nvidia chip on and i915 in use
i915 early KMS, nouveau no KMS (modeset=0) and blacklisted = Nvidia chip on and i915 in use

I presume that early KMS runs before udev, so the nouveau driver is loaded then removed again due to the blacklist. I guess this would turn on the Nvidia chip, so KMS for nouveau is probably best left disabled?

This is starting to look like both chips are switched on at boot by the firmware, and Linux doesn't know how to switch the Nvidia chip off (nor me) sad

P.S. I should point out that my test for the Nvidia chip's power is not very scientific. When booted into OSX with the Nvidia chip off, my laptop runs much, much cooler. When running Nouveau it runs much hotter, and fails to be any cooler with i915.

Last edited by tjbp (2013-10-16 11:41:10)

Offline

#7 2013-10-16 21:07:48

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,967

Re: Can I boot to a specific GPU?

try running xrandr --listproviders

Also check xorg.0.log output to see if it detects 1 or 2 cards


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#8 2013-10-17 20:31:38

tjbp
Member
Registered: 2010-11-06
Posts: 43

Re: Can I boot to a specific GPU?

xrandr --listproviders causes X to segfault:

[126526.304] (EE) Backtrace:
[126526.304] (EE) 0: /usr/bin/X (xorg_backtrace+0x3d) [0x57f67d]
[126526.304] (EE) 1: /usr/bin/X (0x400000+0x1833e9) [0x5833e9]
[126526.304] (EE) 2: /usr/lib/libpthread.so.0 (0x7fd16a9e1000+0xf870) [0x7fd16a9f0870]
[126526.304] (EE) 3: /usr/bin/X (RRTellChanged+0x55) [0x4ec165]
[126526.304] (EE) 4: /usr/bin/X (RRGetInfo+0xa8) [0x4f0278]
[126526.304] (EE) 5: /usr/bin/X (xf86Wakeup+0x508) [0x4749c8]
[126526.304] (EE) 6: /usr/bin/X (WakeupHandler+0x6d) [0x43b5cd]
[126526.304] (EE) 7: /usr/bin/X (WaitForSomething+0x1af) [0x57cc4f]
[126526.304] (EE) 8: /usr/bin/X (0x400000+0x37111) [0x437111]
[126526.304] (EE) 9: /usr/bin/X (0x400000+0x2693a) [0x42693a]
[126526.304] (EE) 10: /usr/lib/libc.so.6 (__libc_start_main+0xf5) [0x7fd169a64bc5]
[126526.304] (EE) 11: /usr/bin/X (0x400000+0x26c81) [0x426c81]
[126526.304] (EE) 
[126526.304] (EE) Segmentation fault at address 0xa4
[126526.304] (EE) 
Fatal server error:
[126526.304] (EE) Caught signal 11 (Segmentation fault). Server aborting

I can't find anything in the X log explicitly stating a detected card - I've always found that log to be pretty cryptic. This is it in its entirety: http://pastebin.com/UHMgSCj4

Offline

#9 2013-10-17 21:35:31

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Can I boot to a specific GPU?

[126526.510] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
...
[126526.510] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so
...
[126526.510] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so

You seem to have both nvidia and nouveau installed? I think you need to get rid of one or the other.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2013-10-18 10:00:47

tjbp
Member
Registered: 2010-11-06
Posts: 43

Re: Can I boot to a specific GPU?

cfr wrote:
[126526.510] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
...
[126526.510] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so
...
[126526.510] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so

You seem to have both nvidia and nouveau installed? I think you need to get rid of one or the other.

Thanks, forgot to remove nvidia-utils from a while back. Unfortunately removing it hasn't had any impact on the issue.

Offline

#11 2013-10-18 12:51:30

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Can I boot to a specific GPU?

tjbp wrote:

i915 early KMS, nouveau early KMS and blacklisted = Nvidia chip on and i915 in use
i915 early KMS, nouveau late KMS and blacklisted = Nvidia chip on and i915 in use
i915 early KMS, nouveau no KMS (modeset=0) and blacklisted = Nvidia chip on and i915 in use

I presume that early KMS runs before udev, so the nouveau driver is loaded then removed again due to the blacklist. I guess this would turn on the Nvidia chip, so KMS for nouveau is probably best left disabled?

This is starting to look like both chips are switched on at boot by the firmware, and Linux doesn't know how to switch the Nvidia chip off (nor me) sad

P.S. I should point out that my test for the Nvidia chip's power is not very scientific. When booted into OSX with the Nvidia chip off, my laptop runs much, much cooler. When running Nouveau it runs much hotter, and fails to be any cooler with i915.

None of this really makes any sense. KMS doesn't "run". It's a feature of any graphics drivers implementing the kernel's DRM framework which is triggered on loading the module. You'll notice your screen resolution change -- or to keep with the lingo, your screen mode will be set by the kernel (hence Kernel ModeSetting).

Blacklisting doesn't unload modules. Rather, it prevents them from being loaded, assuming that you honor them (this should be the case here). I'm not sure where you picked up the idea that blacklisting is some stateful process which unloads modules.

Furthermoe, I have my doubts that you've successfully blacklisted nouveau from loading in your tests. If you add modprobe.blacklist=nouveau to the kernel commandline and reboot, what's the output of lsmod? What's in your /etc/mkinitcpio.conf?

Offline

#12 2013-10-18 13:39:00

tjbp
Member
Registered: 2010-11-06
Posts: 43

Re: Can I boot to a specific GPU?

Apologies, for some reason I was under the impression that there were multiple opportunities to load modules in the boot process, which I now see is daft.

As for correct blacklisting, I've just tried booting with both a blacklist in /etc/modprobe.d and modprobe.blacklist=nouveau as a kernel parameter and the Nvidia chip stays on.

lsmod: http://pastebin.com/JP8x8QY0

/etc/mkinitcpio.conf: http://pastebin.com/i8F96C9G

Offline

#13 2013-10-18 14:02:36

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Can I boot to a specific GPU?

tjbp wrote:

Apologies, for some reason I was under the impression that there were multiple opportunities to load modules in the boot process, which I now see is daft.

Module loading is never-ending because it's based on hotplug events. However, in "most" systems, there's 2 distincts occasions in which module loading tends to occur en masse. Once when ``udevadm trigger'' is called in the initramfs, and in later userspace when trigger is called again.

tjbp wrote:

As for correct blacklisting, I've just tried booting with both a blacklist in /etc/modprobe.d and modprobe.blacklist=nouveau as a kernel parameter and the Nvidia chip stays on.

If the card is powered without the module being loaded, then it sounds like you're out of luck. acpi_call or firmware level disabling is your only hope. I'd suggest contacting the developers of acpi_call to see if they can help you.

Offline

#14 2013-10-18 14:13:01

tjbp
Member
Registered: 2010-11-06
Posts: 43

Re: Can I boot to a specific GPU?

Many thanks for the advice and explanations (everyone else too) - I'll contact the acpi_call devs and if any progress is made I'll post here.

Offline

Board footer

Powered by FluxBB