Prime/Reverse prime - How to find out which physical ports are connected to which GPU

when i run xrandr --listproviders (this is with prime-select on-demand)

Providers: number : 2
Provider 0: id: 0x43 cap: 0x9, Source Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting
Provider 1: id: 0x28e cap: 0x2, Sink Output crtcs: 4 outputs: 7 associated providers: 1 name:NVIDIA-G0

but how can i work out the names of the outputs ?

The problem I am trying to solve is: my old laptop with nvidia/intel optimus would allow me to use my intel gpu to drive the laptop screen and an external display by hdmi port. I was then able to use the nvidia gpu in a vm.

I bought a newer version of the same laptop… but I can’t get it to output via hdmi with the intel gpu selected using prime-select. But I need to work out if this is a hardware issue or something I am not configuring properly. It used to just work okay on the old laptop but now even getting the nvidia gpu to output to hdmi is difficult.

I don’t know how to do that, but I may have an idea whats wrong.
Your output looks quite weird, but it seems like the iGPU has only access to the laptops display.
It is weird because with prime render offload, in my case, the outputs available to nvidia are dublicated and then appear as OUTPUT-0 on modesetting driver. I am not sure about the third DP (DP-1-1) output.

lukas ~: xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x44 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 3 associated providers: 1 name:modesetting
Provider 1: id: 0x23e cap: 0x2, Sink Output crtcs: 4 outputs: 3 associated providers: 1 name:NVIDIA-G0

lukas ~: xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1920x1080 59.98*+ 59.97 59.96 59.93 39.98
/…/ – has lots more of resolutions to choose from, but that is irrelevant
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-0 disconnected
DP-1-0 disconnected
DP-1-1 disconnected

Most likely DP has three outputs because of USB-C port (besides mini-DP), that can also manage a display.
More mysterious to me is that your outputs don’t duplicate NVIDIA->intel.
Could you run “xrandr” and show the output? Also, what distro are you on?
Also, have you fiddled with xorg.conf files? It looks like it is configured properly, but you never know… You can try creating this file:

/etc/X11/xorg.conf

…and paste this into it:

Section “Device”
Identifier “iGPU”
Driver “modesetting”
EndSection
Section “Screen”
Identifier “iGPU”
Device “iGPU”
EndSection
Section “Device”
Identifier “dGPU”
Driver “nvidia”
EndSection

Easy way to do that would be:

sudo nano /etc/X11/xorg.conf

Then copy the mentioned text, and to paste press CTRL+SHIFT+V, press CTRL+O, ENTER and CTRL+X

If the file already exists and has something in it, instead of running “sudo nano …” run “cat /etc/X11/xorg.conf”, and paste the output in a reply.

Also, read this: If you have a problem, PLEASE read this first

As a rule of thumb, you will get a response sooner if you also add background information (Distro/OS, hardware, configuration, the file that article above mentions…).
Happy digging!