prime-select nvidia > log off doesn't work, but reboot does on 375, Quadro M1000M, Dell Precision 550

Just as a note, I’m not running Ubuntu, so paths and filenames might not be correct.
With Ubuntu/systemd gpumanager.service is set to start before display-manager.service start/restart.
When zapping gdm, gdm(3?).service restarts.
Now it depends on how Ubuntu glued together gdm.service and display-manager.service and systemd reacts to this. Obviously in a way it doesn’t get restarted. So the easy workaround would be to alter gpumanager.service to start on gdm.service instead of display-manager.service. Maybe gdm.service has to be altered too. Changes made will be reverted on update of gpumanager i.e. ubuntu-drivers-common but those are rare.

The touchpad not working is a side-effect of the acpi_osi setting, unfortunately the most difficult one to work around.
The background is, there are currently several kernel acpi bugs hitting current laptops with nvidia gpus, yours looks like it’s hit by this
https://bugzilla.kernel.org/show_bug.cgi?id=156341
and probably also this
https://bugs.acpica.org/show_bug.cgi?id=1333

So without the acpi_osi settings you will likely have freezes and hangs when turning on/off the dGPU.
Just try to run without them but keep an eye on dmesg, in the first logfile you posted the dGPU failed to power off, which can be ugly especially on suspend/resume.
To get your touchpad working and work around the power management issues, you will have to alter your corresponding ACPI table, in your case it is ssdt9.
Here somebody made some scripts:

WARNING: this is for a different laptop which has its dGPU methods in ssdt5 so the scripts have to be altered for yours.
With an altered ACPI table for the dGPU you don’t need the acpi_osi settings anymore and touchpad works again.

Ah! The gpu-manager issue isn’t much of a problem. I could just install the prime-indicator applet and change it to run systemctl restart display-manager instead of simply logging out.

Unfortunately, I’m unable to disassemble my DSDT files the way they have in that ACPI table patching script(GitHub - r0l1/razer_blade_14_2016_acpi_fix: ACPI firmware fix for the Razer Blade 14 2016).

~/Documents/dsdt/new2$ ls
DSDT.dat  SSDT10.dat  SSDT11.dat  SSDT1.dat  SSDT2.dat  SSDT3.dat  SSDT4.dat  SSDT5.dat  SSDT6.dat  SSDT7.dat  SSDT8.dat  SSDT9.dat
~/Documents/dsdt/new2$ iasl -e *.dat -d SSDT9.dat 

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20170303
Copyright (c) 2000 - 2017 Intel Corporation

Input file SSDT9.dat, Length 0xB4 (180) bytes
ACPI: SSDT 0x0000000000000000 0000B4 (v02 SgRef  SgPeg    00001000 INTL 20160422)
External object resolution file       SSDT11.dat
Input file SSDT11.dat, Length 0x651 (1617) bytes
ACPI: SSDT 0x0000000000000000 000651 (v02 PmRef  Cpu0Ist  00003000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file       SSDT10.dat
Input file SSDT10.dat, Length 0x1D06 (7430) bytes
ACPI: SSDT 0x0000000000000000 001D06 (v01 OptRef OptTabl  00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT8.dat
Input file SSDT8.dat, Length 0x28D (653) bytes
ACPI: SSDT 0x0000000000000000 00028D (v02 INTEL  zpodd    00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT7.dat
Input file SSDT7.dat, Length 0x3002 (12290) bytes
ACPI: SSDT 0x0000000000000000 003002 (v02 INTEL  PtidDevc 00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT6.dat
Input file SSDT6.dat, Length 0x29F (671) bytes
ACPI: SSDT 0x0000000000000000 00029F (v02 INTEL  sensrhub 00000000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT5.dat
Input file SSDT5.dat, Length 0xEDE (3806) bytes
ACPI: SSDT 0x0000000000000000 000EDE (v02 CpuRef CpuSsdt  00003000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT4.dat
Input file SSDT4.dat, Length 0x98A (2442) bytes
ACPI: SSDT 0x0000000000000000 00098A (v02 INTEL  xh_rvp11 00000000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT3.dat
Input file SSDT3.dat, Length 0x28D3 (10451) bytes
ACPI: SSDT 0x0000000000000000 0028D3 (v02 PegSsd PegSsdt  00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT2.dat
Input file SSDT2.dat, Length 0x340B (13323) bytes
ACPI: SSDT 0x0000000000000000 00340B (v02 SaSsdt SaSsdt   00003000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT1.dat
Input file SSDT1.dat, Length 0x2F2 (754) bytes
ACPI: SSDT 0x0000000000000000 0002F2 (v01 SataRe SataTabl 00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file         DSDT.dat
Input file DSDT.dat, Length 0x2F3D8 (193496) bytes
ACPI: DSDT 0x0000000000000000 02F3D8 (v02 _ASUS_ Notebook 01072009 INTL 20160422)
Pass 1 parse of [DSDT]
ACPI Error: [PRT0] Namespace lookup failure, AE_ALREADY_EXISTS (20170303/dswload-498)
ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20170303/psobject-360)
Could not parse external ACPI tables, AE_ALREADY_EXISTS

Remove ssdt10.dat, try again.

I removed SSDT10.dat. Still doesn’t disassemble.

~/Documents/dsdt/new2$ iasl -e *.dat -d SSDT9.dat 

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20170303
Copyright (c) 2000 - 2017 Intel Corporation

Input file SSDT9.dat, Length 0xB4 (180) bytes
ACPI: SSDT 0x0000000000000000 0000B4 (v02 SgRef  SgPeg    00001000 INTL 20160422)
External object resolution file       SSDT11.dat
Input file SSDT11.dat, Length 0x651 (1617) bytes
ACPI: SSDT 0x0000000000000000 000651 (v02 PmRef  Cpu0Ist  00003000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT8.dat
Input file SSDT8.dat, Length 0x28D (653) bytes
ACPI: SSDT 0x0000000000000000 00028D (v02 INTEL  zpodd    00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT7.dat
Input file SSDT7.dat, Length 0x3002 (12290) bytes
ACPI: SSDT 0x0000000000000000 003002 (v02 INTEL  PtidDevc 00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT6.dat
Input file SSDT6.dat, Length 0x29F (671) bytes
ACPI: SSDT 0x0000000000000000 00029F (v02 INTEL  sensrhub 00000000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT5.dat
Input file SSDT5.dat, Length 0xEDE (3806) bytes
ACPI: SSDT 0x0000000000000000 000EDE (v02 CpuRef CpuSsdt  00003000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT4.dat
Input file SSDT4.dat, Length 0x98A (2442) bytes
ACPI: SSDT 0x0000000000000000 00098A (v02 INTEL  xh_rvp11 00000000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT3.dat
Input file SSDT3.dat, Length 0x28D3 (10451) bytes
ACPI: SSDT 0x0000000000000000 0028D3 (v02 PegSsd PegSsdt  00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT2.dat
Input file SSDT2.dat, Length 0x340B (13323) bytes
ACPI: SSDT 0x0000000000000000 00340B (v02 SaSsdt SaSsdt   00003000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        SSDT1.dat
Input file SSDT1.dat, Length 0x2F2 (754) bytes
ACPI: SSDT 0x0000000000000000 0002F2 (v01 SataRe SataTabl 00001000 INTL 20160422)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file         DSDT.dat
Input file DSDT.dat, Length 0x2F3D8 (193496) bytes
ACPI: DSDT 0x0000000000000000 02F3D8 (v02 _ASUS_ Notebook 01072009 INTL 20160422)
Pass 1 parse of [DSDT]
ACPI Error: [PRT0] Namespace lookup failure, AE_ALREADY_EXISTS (20170303/dswload-498)
ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20170303/psobject-360)
Could not parse external ACPI tables, AE_ALREADY_EXISTS

I used the tables from the acpidump so I have much more .dat files. Put back the ssdt10.dat file and then
grep PRT0 *
It will tell you which file contains the duplicate definition to remove. Of course don’t remove dsdt.dat.
If the dat files are reordered, you should grep first for LKEN to know the right ssdt to alter.

The acpidump files and the SSDT files in /sys/firmware/acpi/tables are mismatched! Its SSDT9 through acpidump, and SSDT3 through /sys/firmware/acpi/tables. I used the /sys/firmware/acpi/tables method since I think that is what the kernel is currently using.

I deleted SSDT1.dat, after which it succesfully disassembled. I replaced all instances of OSYS except the declaration in SSDT3.dsl to 0x07D9. And then I bumped the number in the DefinitionBlock line by 1. I then followed these instructions to compile it and pack into an image: DSDT - ArchWiki

After booting with the new DSDT image, I am able to switch between GPUs without rebooting.

Sounds fine. Care to do some switching and generate another nvidia-bug-report.sh?

Sure. Here: nvidia bug report · GitHub

I added my modified SSDT file to GRUB. Then:

  1. Log in through GDM
  2. Run prime-select
  3. Run systemctl restart display-manager
  4. Log in again
  5. Run nvidia-bug-report

Also, there was this issue where GDM wouldn’t start if the charger was connected. That also seems to have been resolved by the changed SSDT file.

Thank you, much appreciated. Everything looks good now. Funny thing is, the kernel always complained and still complains about the duplicate ACPI definition, too. So the ssdt you had to remove in order to disassemble was never loaded anyway.

Very weird.

Thank you very much for your help!
I’ve linked to this post at this thread in the Bumblebee repo: Laptop freezes when starting X11 and discrete graphics are OFF · Issue #764 · Bumblebee-Project/Bumblebee · GitHub
Lot of people are using the acpi_osi workaround there.