This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Display error while debugging remotely an OpenCV code

I am trying to use DS-5 debugger to debug remotely an OpenCV code, that simply reads and displays an image. The target platform is Hardkernel ODROID-XU4 SBC running on Ubuntu 18.04, and the host is a Windows 7 host PC. Everything works just fine and I can debug and step into different regions in my program, however, when I try to display the image in my PC, I get the error depicted in the following debug log

Preparing the debug session

# cd "/home/bin"
# export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
# gdbserver :5000 "./opencv_cross_tutorial" 
Process ./opencv_cross_tutorial created; pid = 2362
Listening on port 5000
Debug session has been started, connecting to gdbserver
Remote debugging from host 192.168.1.36
Unable to init server: Could not connect: Connection refused

(Display window:2362): Gtk-WARNING **: 16:50:47.229: cannot open display: 

Child exited with status 1

I would like to know, how can I resolve this display error and display the image on my host PC, and how can I export the display to the ODROID since it is connected to an LCD screen ? 

  • Hi TakiEddine

    Have you tried setting the DISPLAY env var first, e.g.:
    export DISPLAY=:0.0
    for a local display, or, for example,
    export DISPLAY=10.11.12.13:0.0
    to open its window on the host's X server, where 10.11.12.13 is the host's IP address

    For examples of this usage, see the Gnometris and Xaos examples in the Arm DS examples.

    Stephen

  • Hi Stephan,

    I tried the Xaos example, and it yields exactly the same error, here is the debug log 

    Preparing the debug session
    
    # cd "/writeable"
    # export DISPLAY=":0.0"
    # export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
    # gdbserver :5000 "./xaos" -threads 5 -autopilot -streamlinevisualannotation
    Process ./xaos created; pid = 5017
    Listening on port 5000
    Debug session has been started, connecting to gdbserver
    Remote debugging from host 192.168.43.27
    Warning gator_func(streamline_annotate.c:496): Not connected to gatord, the application will run normally but Streamline will not collect annotations. To collect annotations, please verify you are running gatord 5.24 or later and that SELinux is disabled.
    No protocol specified
    
    (xaos:5017): Gtk-WARNING **: 12:37:43.483: cannot open display: :0.0
    
    Child exited with status 1
    

    What is the possible issue here ?

  • I have found the solution in the web, logging in my odroid as "root" and executing the following command solved the problem

    xhost +SI:localuser:root

    I can now view the graphical output of my applications either locally or remotely.