My second screen is not working after installing nvidia

My second display is not in the config, and it is just showind the wallpaper and an x as the mouse

This is my nvidia settings

inxi -Ga logs

inxi -Ga
  Device-1: NVIDIA GA104 [GeForce RTX 3070 Lite Hash Rate] vendor: Gigabyte
    driver: nvidia v: 520.56.06 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-10) arch: Ampere code: GAxxx process: TSMC n7
    (7nm) built: 2020-22 pcie: gen: 2 speed: 5 GT/s lanes: 16 link-max:
    gen: 4 speed: 16 GT/s bus-ID: 2b:00.0 chip-ID: 10de:2488 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.4
    compositor: kwin_x11 driver: X: loaded: nvidia gpu: nvidia display-ID: :0
    screens: 2 default screen: 0
  Screen-1: 0 s-res: 5120x1440 s-dpi: 108 s-size: 1204x342mm (47.40x13.46")
    s-diag: 1252mm (49.28")
  Monitor-1: DP-2 res: 5120x1440 hz: 60 dpi: 130048
    size: 1x1mm (0.04x0.04") diag: 1mm (0.06") modes: N/A Screen: 1
    s-res: 1440x2560 s-dpi: 108 s-size: 340x610mm (13.39x24.02")
    s-diag: 698mm (27.49")
  Screen-2: 0 s-res: 5120x1440 s-size: <missing: xdpyinfo>
  Monitor-1: DP-2 res: 5120x1440 hz: 60 dpi: 130048
    size: 1x1mm (0.04x0.04") diag: 1mm (0.06") modes: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 3070/PCIe/SSE2 v: 4.6.0 NVIDIA
    520.56.06 direct render: Yes

Please i need help to start using my second monitor

what does your xrandr say? Maybe configure it directly that that or arandr?

Screen 0: minimum 8 x 8, current 5120 x 1440, maximum 32767 x 32767
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 5120x1440+0+0 (normal left inverted right x axis y axis) 1mm x 1mm
   3840x1080     59.97 +
   5120x1440     59.98*   29.98  
   2560x1080     59.98    59.94  
   1920x1080     60.00    59.94    50.00  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-3 disconnected (normal left inverted right x axis y axis)

There’s several conflicting pieces of information here, I’m not sure how to fix it. Inxi is showing 2 screens each with the same monitor(Monitor-1) and port(DP-2). Nvidia is showing the separate monitors and the port(DP-0) it should be on. Does nvidia show your monitors attached to different screens? And xrandr doesn’t see the the second monitor port.

Maybe it’s an xorg conf conflict? If you have any X11 xorg configs back them up and remove them, you shouldn’t need them. Or, maybe start with creating a new user profile first?

Did you apply settings from nvidia? Can you change which xscreen is assigned from there? That software tends to screw things up more than it fixes in my experience.

This looks like a very corner case bug with inxi Screens logic to me. Not sure what makes it happen, but the Xrandr Screen should not have been added to the Screens array if that array was already loaded from xdpyinfo with a screen count of 1.

Seeing full xdpyinfo output would be helpful to narrow this down.

It’s also possible that when inxi was run to create the above output, xrandr was incorrectly showing a second ‘Screen 0’ line.

While I don’t think we’ll ever find the real cause of this bug in output, nor will I ever understand how the above inxi output was even generated in the first place, while looking through pinxi to find any possible cause, I did find some super corner case xscreen issues, which should now all be corrected.

Without the real xrandr and xdpyinfo output generated at the moment the above inxi output was generated, I doubt I’ll ever be able to solve the actual bug, but the fixes I added in, and some new protections, should avoid creating a new Screen if the second has the same Screen ID (0 in this case) as the first, actually if any subsequent screen has an ID same as one already discovered.

The repeated Monitor stuff should also not happen again, that was due to a slightly different giltch, a Perl error I made.

I wish I could discover how this bug happened, what the source data to create it was, but it’s so corner case I doubt I ever will, but the new code should block such errors in the future from at least showing, though they may still manifest somewhere internally, but they will be trapped and dumped as bad data in the future.