Displaying the result of a remotely run code on Jetson attached display

I am using screeninfo utility to run the code on the first display of the jetson.

However, when I run the code remotely from my laptop using ssh, I am able to show the results on the jetson attached display and I get an error.

I am not allowed to use vnc/teamviewer/nomachine/alike and only can ssh.

  File "/home/mona/.local/lib/python3.10/site-packages/screeninfo/screeninfo.py", line 32, in get_monitors
    raise ScreenInfoError("No enumerators available")
screeninfo.common.ScreenInfoError: No enumerators available

if I try

$ Xvfb :0 -ac &
$ export DISPLAY=:0
$ python my_code.py

It runs but then shows the dimension of the display for my laptop not the one attached to jetson.

How can I fix this and run the code remotely from my laptop and show results on the jetson attached display? I also tried

$ Xvfb :99 -ac &
$ export DISPLAY=:99
$ python my_code.py

But same situation.

also

mona@ubuntu:~$ DISPLAY=:0 xeyes
Error: Can't open display: :0
mona@ubuntu:~$ cat /etc/X11/xorg.conf
# Copyright (c) 2011-2013 NVIDIA CORPORATION.  All Rights Reserved.

#
# This is the minimal configuration necessary to use the Tegra driver.
# Please refer to the xorg.conf man page for more configuration
# options provided by the X server, including display-related options
# provided by RandR 1.2 and higher.

# Disable extensions not useful on Tegra.
Section "Module"
    Disable     "dri"
    SubSection  "extmod"
        Option  "omit xfree86-dga"
    EndSubSection
EndSection

Section "Device"
    Identifier  "Tegra0"
    Driver      "nvidia"
# Allow X server to be started even if no display devices are connected.
    Option      "AllowEmptyInitialConfiguration" "true"
EndSection

mona@ubuntu:~$ cat /var/log/Xorg.0.log | grep EE
[    14.059] Current Operating System: Linux ubuntu 5.15.136-tegra #1 SMP PREEMPT Mon May 6 09:56:39 PDT 2024 aarch64
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    14.736] (EE) NVIDIA(0): Failed to allocate NVIDIA Error Handler
[    14.796] (II) Initializing extension MIT-SCREEN-SAVER
mona@ubuntu:~$ sudo xhost +SI:localuser:$USER
xhost:  unable to open display ":0"
mona@ubuntu:~$ sudo xhost +local:
xhost:  unable to open display ":0"
mona@ubuntu:~$ ls -l /run/user/1000/gdm/Xauthority
-rwx------ 1 mona mona 100 Oct  8 10:17 /run/user/1000/gdm/Xauthority
mona@ubuntu:~$ cp /run/user/1000/gdm/Xauthority ~/.Xauthority
mona@ubuntu:~$ export XAUTHORITY=~/.Xauthority
mona@ubuntu:~$ DISPLAY=:0 xeyes
Error: Can't open display: :0
mona@ubuntu:~$ cat /etc/ssh/sshd_config | grep X11Forwarding
X11Forwarding yes
#	X11Forwarding no
mona@ubuntu:~$ echo $DISPLAY
:0


mona@ubuntu:$ DISPLAY=:1 python mycode.py
$ who
mona     :1           2024-10-08 10:17 (:1)
mona     pts/1        2024-10-08 10:57

I was using 0 by mistake

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