Failed to initialize X Screen

There are two HDMI output port (one is HDMI-0, another is DP-0) on NVIDIA GPU NVIDIA Tegra X1 (nvgpu) (GM20B) at SoC (GPU-0). When there isn’t a monitor connected to DP-0 port and restart the ubuntu system, errors will appear in the Xorg.0.log located in /var/log directory. The errors are below:

[ 6.675] (EE) NVIDIA(1): Failed to assign any heads to X screen 1
[ 6.675] (EE) NVIDIA(1): Failing initialization of X screen 1

The Xorg.0,log and xorg.conf located in /etc/X11/xorg.conf.d are attached.

Please tell me how to fix the X screen initialization error. Thanks a lot.

xorg.conf (2.7 KB)
Xorg.0.log (17.8 KB)

It seems coming from that you add this line.

Screen 1
Option “Monitor-DP-0” “Monitor1”
EndSection

You should also follow the previous setting with Option “AllowEmptyInitialConfiguration” “true”.

Google search this property and you will find out the meaning of this property.

Remove the line Option “Monitor-DP-0” “Monitor1” and other options, add line Option “AllowEmptyInitialConfiguration” “true” for Device1 section. But the same errors occurred in Xorg.0.log, It seems that the option AllowEmptyInitialConfiguration doesn’t work.

The new Xorg.0,log and xorg.conf are also attached.

Thanks a lot.
xorg.conf (2.5 KB)
Xorg.0.log (17.2 KB)

Hello,

But if the DP is connected, then screen 1 can work fine?

Also, will HDMI on the screen 0 have similar issue?

Yes, It works fine and no error occur.

The HDMI-0 port hasn’t this issue. another HDMI output port is converted from DP-0.

Thanks a lot

If you are using a DISPLAY of monitor 1 (“DISPLAY=:1”) instead of monitor 0, which might be occurring in this case, then the log is not “Xorg.0.log”…the log for “DISPLAY=:1” would be “Xorg.1.log”. Make sure you are using the correct log since one GPU can run different displays (extending a desktop does not add a new DISPLAY, but having two independent desktops does require a new DISPLAY). It is quite possible you have just “:0”, but make sure when you look at which Xorg.#.log files you have.

No Xorg.1.log file in /var/log directory whether DP-0 connected monitor or not.

When two HDMI output ports (HDMI-0 and DP-0) connect monitors, execute xrandr and display like this:

scala@localhost:~$ DISPLAY=:0.1 xrandr
Screen 1: minimum 8 x 8, current 1280 x 720, maximum 16384 x 16384
DP-0 connected primary 1280x720+0+0 (normal left inverted right x axis y axis) 7 00mm x 390mm
1280x720 60.00*+ 59.94 50.00
1920x1080 60.00 59.95 50.00
1440x900 84.85 74.99 59.89
1280x1024 75.03
1024x768 75.03 70.07 60.01
800x600 75.00 72.19 60.32 56.25
720x576 50.00
720x480 59.94
720x400 70.04
640x480 75.00 72.81 59.94
scala@localhost:~$ DISPLAY=:0.0 xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
1920x1080 60.00*+ 60.00
1280x1024 60.00
1280x720 60.00 59.94
1024x768 60.01
800x600 60.32
scala@localhost:~$ cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

When HDMI-0 connects a monitor and DP-0 doesn’t connect a monitor, execute xrandr and display like this

scala@localhost:~$ DISPLAY=:0.0 xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
1920x1080 60.00*+ 60.00
1280x1024 60.00
1280x720 60.00 59.94
1024x768 60.01
800x600 60.32
DP-0 disconnected (normal left inverted right x axis y axis)
scala@localhost:~$ DISPLAY=:0.1 xrandr
Can’t open display :0.1
scala@localhost:~$

Hi, I uplaod our command, so we just had Xorg.0.log.

Yes, the format is that the “:0” is the DISPLAY, and log is named related to this. The “:0.1” is just a different screen of the same desktop. A single server splitting its output to two locations. Had the two monitors been truly independent and run separate content, then it would have been “:1” (and “:0”). So your log is the correct one. Just wanted to make sure since with two monitors it is possible to have two separate logs.

Please focus on the X Screen initialization failure issue, would you please tell me the possible reasons and how to fix it.

Thanks again.

I couldn’t give you a complete list. The screen being initialized must be running under the same user as the person launching the process for security reasons. Another issue is that any screen your DISPLAY is set to must have the ability to run the software…an example being that if the video card did not support OpenGL of a particular release, and if the software was trying to use that release, then this too would fail. Is there a display actually running at the moment you run your command? Does the output of “echo $DISPLAY” from a running terminal have the same value as the “$DISPLAY” you are setting before running the program?

I couldn’t even begin to guess with the information available to know what the cause is. Certainly the Xorg logs are a good start, but those logs may leave out information related to the environment you are running in.

Hi :
for the errors:
[ 6.675] (EE) NVIDIA(1): Failed to assign any heads to X screen 1
[ 6.675] (EE) NVIDIA(1): Failing initialization of X screen 1
where are they in the code? We didn’t find it.

This is not public code. I am still checking this internally.

Hi,please support us , thank you!

I have a similar issue as well and it fails during xinit

ok,If you need us to grab logs, we are happy to do it.Thanks!

Hi, any update?

What logs do you need exactly ??