Unable to use internal screen with egpu+dgpu hybrid setup

Hello! I recently got a GTX 1070ti and a razer core x egpu enclosure and wanted to do some Isaac gym work - however after following the thread here I am able to get the egpu output to an external monitor but the internal screen on the laptop remains black. My laptop has only hybrid mode graphics and I am currently in prime-select on-demand mode. Is there anyway to get the internal display to work? Thank you!
nvidia-bug-report.log.gz (510.2 KB)
I’ve set options nvidia-drm modeset=0 in /lib/modprobe.d/nvidia-kms.conf and /etc/modprobe.d/nvidia-graphics-drivers-kms.conf.
Below is the output of xrandr --listproviders

Providers: number : 3
Provider 0: id: 0x1b7 cap: 0x0 crtcs: 4 outputs: 8 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x36c cap: 0x2, Sink Output crtcs: 3 outputs: 4 associated providers: 0 name:modesetting
Provider 2: id: 0x346 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

This is my /etc/X11/xorg.conf :

Section "ServerLayout"
    Identifier     "layout"
    Screen      0  "nvidia" 0 0
    Inactive       "intel"
EndSection

Section "Files"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
EndSection

Section "Device"
    Identifier     "intel"
    Driver         "modesetting"
    Option         "AccelMethod" "none"
    BusID          "PCI:0:2:0"
EndSection

Section "Device"
    Identifier     "nvidia"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:7:0:0"
    Option         "AllowEmptyInitialConfiguration"
    Option         "AllowExternalGpus" "true"
    Option         "PrimaryGPU" "true"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
    Monitor        "Monitor0"
EndSection

Section "Device"
    Identifier     "nvidia-internal"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Apparently, when I boot into windows and then reboot into linux it works - probably a thunderbolt detection issue.

Which makes me thinking - is there a way to detect thunderbolt devices before starting gdm?

You could disable security options in the BIOS, and thus force the TB devices to be detected at boot instead of after [software] TB init (which enforces security protocols). TB security is really only an issue in office and travel environments.

EDIT: it works! Turn on thunderbolt boot assist and enable the detection, profit!

Thank you!