UDP socket is not recieving when I compile my code from nsight eclipse edition

Hello,

I’ve been trying to compile a basic udp cleint/server code using nsight and push the code to my TX2 remotely. The the code compiles and I can see that its running on the TX2 and the UDP socket has binded but it wont receive anything.

I was following this as a guide - https://devblogs.nvidia.com/cuda-jetson-nvidia-nsight-eclipse-edition/

Please help - Thank you

Hi,

Could you help to verify your UDP code on the host first?
Thanks.

Also check to be sure no firewall rule is rejecting the packet (the Jetson wouldn’t be set up to firewall, but the host might…or if in a business LAN perhaps the LAN itself). To start with perhaps do both send and receive from the Jetson to itself. Then go to separate hosts.

Hi Thanks for the reply,

The way it’s set up is that I have the “udp” code as a class in a separate .cpp file and .h file. I just declare that header file on a separate main.cpp file. When I compile the same code on the TX2 using g++ compiler my code works fine.

Its when I use nsight and compile the same code and send the binary to tx2 as mentioned here- https://devblogs.nvidia.com/cuda-jetson-nvidia-nsight-eclipse-edition/, it runs but the recvfrom() always return -1.

However, if I copy all the functions from that class in my main.cpp file and compile just the main.cpp file. it works fine.

I have the file structure is:

  • cuda-workspace
    1. project-folder
      1. src
      • main.cpp
    2. library
    • udp.cpp
    • udp.h

I have added the file path to include path under properties>>build>>settings>>Tool Settings>>Include paths(-I)

I have also added the source file path under properties>>C/C++General>>Path and Symbols>>Source Location.

The udp communication is happening between two processes communicating on localhost 127.0.0.1:1234

A communication between two process has been achieved when I compile with g++ on the tx2.

You are right - there is no firewall rules on jetson.

It matters if the host has firewall rules? The host only compiles and send the binary to jetson tx2 and the binary runs on the TX2 right?

I also tried running the binary from jetson tx2 instead of using nsight but the result was the same.

Maybe a setting on nsight that I am missing??

If the UDP is between host and Jetson, then host firewall can get in the way even if copy succeeds. If UDP is between a Jetson and itself, or another Jetson, then host firewall won’t matter. High end “managed” network switches usually have firewalling as well, and this would matter in all cases.

If you can run the “file /some/file/to/check” command on your executable, then see if it claims to be arm64/aarch64…perhaps something is not as it seems. Also, from the Jetson itself, what do you see from “ldd /some/file/you/created”?

Also, perhaps in one case the user doing the execution differs, in which case “sudo” would probably help.