How to detect if a DP (DisplayPort) monitor has been plugged in?

Hi NVIDIA team,

I need to determine whether the monitor is connected through software. After plugging in the monitor, the Ubuntu desktop can be displayed, but xrandr shows “Can’t open display :0”. Additionally, cat /sys/class/drm/card1-DP-1/status returns “disconnected”. when the monitor is plugged in, there is no output in dmesg .

device: Jetson AGX Orin 64GB Developer kit
Jetson: 36.4
jetpack: jp6.1

Thank you in advance!

*** Please note that this reply is generated by LLM automatically ***

I’m happy to help you with your issue!

Firstly, I’d like to clarify that the error message “Can’t open display :0” typically indicates that the X server (the display server on Linux systems) is not able to connect to the display. This can be due to various reasons, including configuration issues, driver problems, or hardware connectivity issues.

Since you’re using a Jetson AGX Orin 64GB Developer kit with Jetpack 6.1, I’ll provide some general troubleshooting steps and potential solutions specific to your setup.

Software Connection

To determine if the monitor is connected through software, you can try the following:

  1. Check the X server logs: Run the command sudo journalctl -u xorg to view the X server logs. Look for any error messages related to the display or monitor connection.
  2. Verify the display settings: Run the command xrandr -q to query the display settings. This should show you the connected displays and their configurations.
  3. Check the NVIDIA driver version: Run the command nvidia-smi to check the NVIDIA driver version. Ensure that the driver is up-to-date and compatible with your Jetpack version.

Hardware Connection

To rule out any hardware connectivity issues:

  1. Verify the monitor connection: Double-check that the monitor is properly connected to the Jetson AGX Orin Developer kit using an HDMI cable.
  2. Try a different HDMI port: If your monitor has multiple HDMI ports, try connecting it to a different port on the Jetson AGX Orin Developer kit.
  3. Check the monitor’s settings: Ensure that the monitor is set to the correct input (HDMI) and that it’s not in a power-saving mode.

Comparison with Similar Issues

If you’re still experiencing issues, you can try searching for similar problems on the NVIDIA forums or online communities. Some potential solutions that might be relevant to your issue include:

  • Updating the NVIDIA driver to the latest version
  • Configuring the X server to use the correct display settings
  • Disabling the NVIDIA GPU and using the integrated GPU instead
  • Checking for any conflicts with other devices connected to the Jetson AGX Orin Developer kit

Additional Information

If none of the above steps resolve the issue, please provide more information about your setup, such as:

  • The exact error message you’re seeing
  • The output of the xrandr -q command
  • The output of the nvidia-smi command
  • Any other relevant details about your system configuration

This will help me provide more specific guidance and troubleshooting steps to resolve your issue.

Try to run “udevadm monitor --env” first and then hotplug your cable and see if new log.

No hotplug log found.
uevnt.txt (22.7 KB)

Let’s go back to the very basic case first.

Please reboot your device. Do not modprobe nvidia-drm driver there. Use the terminal on your Ubuntu GUI and run xrandr again and please do not run it as root.

The problem with xrandr is that I used the root user.

I executed xrandr via SSH.the outputs of xrandr before and after plugging/unplugging are exactly the same, as if there’s no way to distinguish whether the monitor is connected or not.

Here are the results of running xrandr from the GUI command line.

Please do not use ssh to check your xrandr. That one seems having Xforward that it reads the monitor info from some remote devices.

Please modprobe nvidia_drm now and check if you have /sys/devices/platform/13800000.display/drm/card1.

If it is there, then please disable GDM3/Xorg and then run the udevadm command I shared in previous one again and hotplug your monitor cable.

When executing sudo service gdm3 stop and then inserting the display, the following udev information will be generated, and the /dev/fb0 node will be created.

I want to confirm whether a monitor is connected to a running device through software. Since there is no plugging or unplugging action, udev will not be triggered in this scenario.

KERNEL[4572.870169] change   /devices/platform/13800000.display/drm/card1 (drm)
ACTION=change
DEVPATH=/devices/platform/13800000.display/drm/card1
SUBSYSTEM=drm
HOTPLUG=1
DEVNAME=/dev/dri/card1
DEVTYPE=drm_minor
SEQNUM=14096
MAJOR=226
MINOR=1

KERNEL[4572.872503] change   /devices/platform/13800000.display/drm/card1 (drm)
ACTION=change
DEVPATH=/devices/platform/13800000.display/drm/card1
SUBSYSTEM=drm
HOTPLUG=1
DEVNAME=/dev/dri/card1
DEVTYPE=drm_minor
SEQNUM=14097
MAJOR=226
MINOR=1

UDEV  [4572.872962] change   /devices/platform/13800000.display/drm/card1 (drm)
ACTION=change
DEVPATH=/devices/platform/13800000.display/drm/card1
SUBSYSTEM=drm
HOTPLUG=1
DEVNAME=/dev/dri/card1
DEVTYPE=drm_minor
SEQNUM=14096
USEC_INITIALIZED=29591073
ID_PATH=platform-13800000.display
ID_PATH_TAG=platform-13800000_display
ID_FOR_SEAT=drm-platform-13800000_display
MAJOR=226
MINOR=1
DEVLINKS=/dev/dri/by-path/platform-13800000.display-card
TAGS=:master-of-seat:seat:uaccess:
CURRENT_TAGS=:master-of-seat:seat:uaccess:

UDEV  [4572.875654] change   /devices/platform/13800000.display/drm/card1 (drm)
ACTION=change
DEVPATH=/devices/platform/13800000.display/drm/card1
SUBSYSTEM=drm
HOTPLUG=1
DEVNAME=/dev/dri/card1
DEVTYPE=drm_minor
SEQNUM=14097
USEC_INITIALIZED=29591073
ID_PATH=platform-13800000.display
ID_PATH_TAG=platform-13800000_display
ID_FOR_SEAT=drm-platform-13800000_display
MAJOR=226
MINOR=1
DEVLINKS=/dev/dri/by-path/platform-13800000.display-card
TAGS=:master-of-seat:seat:uaccess:
CURRENT_TAGS=:master-of-seat:seat:uaccess:

KERNEL[4572.977894] add      /devices/platform/13800000.display/graphics/fb0 (graphics)
ACTION=add
DEVPATH=/devices/platform/13800000.display/graphics/fb0
SUBSYSTEM=graphics
DEVNAME=/dev/fb0
SEQNUM=14098
MAJOR=29
MINOR=0

UDEV  [4572.979231] add      /devices/platform/13800000.display/graphics/fb0 (graphics)
ACTION=add
DEVPATH=/devices/platform/13800000.display/graphics/fb0
SUBSYSTEM=graphics
DEVNAME=/dev/fb0
SEQNUM=14098
USEC_INITIALIZED=4572979091
ID_PATH=platform-13800000.display
ID_PATH_TAG=platform-13800000_display
ID_FOR_SEAT=graphics-platform-13800000_display
PRIMARY_DEVICE_FOR_DISPLAY=1
MAJOR=29
MINOR=0
TAGS=:seat:
CURRENT_TAGS=:seat:

Just follow the operations below to detect the plugging and unplugging status of the monitor.

echo detect | sudo tee /sys/class/drm/card1-DP-1/status > /dev/null
cat /sys/class/drm/card1-DP-1/status

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.