linux-surface / surface-aggregator-module

Linux ACPI and Platform Drivers for Surface Devices using the Surface Aggregator Module over Surface Serial Hub (Surface Book 2, Surface Pro 2017, Surface Laptop, and Newer)
GNU General Public License v2.0
95 stars 11 forks source link

Bumblebee Support #28

Open mr-remington opened 5 years ago

mr-remington commented 5 years ago

This looks ACPI related. I'm running Ubuntu 18.10. After upgrading to 4.19 from Jake, I found out the 390 drivers are unsupported in 4.19 so I upgraded the nvidia driver to 410.

410 no longer uses prime-select and prefers bumblebee/optirun to enable the graphics card.

remi@sb2:~$ optirun firefox
[  549.113374] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

[  549.113409] [ERROR]Aborting because fallback start is disabled.

Looking at dmesg:

[  265.746948] bbswitch: version 0.8
[  265.746960] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[  265.746978] bbswitch: Found discrete VGA device 0000:02:00.0: \_SB_.PCI0.RP05.PXSX
[  265.747354] bbswitch: No suitable _DSM call found.

The device ID properly maps to the nvidia card but that _DSM call looks like ACPI related. Any ideas?

qzed commented 5 years ago

Hmm yeah, I haven't gotten bbswitch to work, not sure what we'd have to do to change that. Also I need to get up to date on the whole GPU switching thing, if I understand it correctly, getting vga-switcheroo to work would be the proper way forward (if that's even possible)? I'll definitely have a look into it.

qzed commented 5 years ago

For anyone interested: I've been working on this. While it's not a drop-in replacement for bbswitch and not supported by bumblebee, you can manually switch the dGPU on before calling optirun and switch it off afterwards.

qzed commented 5 years ago

Moved from https://github.com/qzed/linux-surfacegen5-acpi, as I want to keep these two modules separate for now and I think this should be handled here.

qzed commented 4 years ago

Moving back to https://github.com/qzed/linux-surfacegen5-acpi as this module is now integrated there.

The feature/dgpu-vgasw branch contains an experimental implementation for vga-switcheroo. You can enable that by setting the module-parameters vgasw=y and vgasw_dummy_client=y. This currently only works via the proprietary nvidia driver, nouveau fails to load properly, which is probably an unrelated issue. Loading the module with these options should then provide the vga-switcheroo debugfs interface (/sys/kernel/debug/vgaswitcheroo/switch).

To get this to work with the bumblebee deamon, some additional configuration thereof is required via its bumblebee.conf file: You explicitly need to specify Driver=nvidia and under [driver-nvidia] you need to set PMMethod=switcheroo. This should then automatically power-on the dGPU when you run stuff with optirun (or pvkrun, ...) and power it off afterwards.