Run a project from Nsight Host
Hi, I want to launch project on my Jetson TX2 from Nsight on Host, but I have a problem: [code] Last login: Tue Nov 21 14:58:11 2017 from 172.22.61.188 echo $PWD'>' /bin/sh -c "cd \"/home/nvidia/host_pc_camera/Debug\";export LD_LIBRARY_PATH=\"/usr/local/cuda-8.0/lib64\":\${LD_LIBRARY_PATH};\"/home/nvidia/host_pc_camera/Debug/host_pc_camera\"";exit nvidia@tegra-ubuntu:~$ echo $PWD'>' /home/nvidia> nvidia@tegra-ubuntu:~$ /bin/sh -c "cd \"/home/nvidia/host_pc_camera/Debug\";export LD_LIBRARY_PATH=\"/usr/local/cuda-8.0/lib64\":\${LD_LIBRARY_PATH};\"/home/nvidia/host_pc_camera/Debug/host_pc_camera\"";exit (host_pc_camera:21674): Gtk-WARNING **: cannot open display: ****** tcambin serial=19710151 ! video/x-raw,format=BGRx,width=640,height=480,framerate=30/1 ! videoconvert ! video/x-raw, format=BGR !appsinklogout[/code] I added it: [code]setenv(“DISPLAY”, “:0”, 0);[/code] But I have an error: [code]../camera.cpp:60:11: error: ‘int setenv’ redeclared as different kind of symbol int setenv("DISPLAY", ":0", 0); ^ In file included from ../camera.cpp:4:0: /usr/include/stdlib.h:584:12: note: previous declaration ‘int setenv(const char*, const char*, int)’ extern int setenv (const char *__name, const char *__value, int __replace) ^ subdir.mk:18: recipe for target 'camera.o' failed make: Leaving directory '/home/nvidia/host_pc_camera/Debug' make: *** [camera.o] Error 1 > Shell Completed (exit code = 2)[/code]
Hi,
I want to launch project on my Jetson TX2 from Nsight on Host, but I have a problem:

Last login: Tue Nov 21 14:58:11 2017 from 172.22.61.188
echo $PWD'>'
/bin/sh -c "cd \"/home/nvidia/host_pc_camera/Debug\";export LD_LIBRARY_PATH=\"/usr/local/cuda-8.0/lib64\":\${LD_LIBRARY_PATH};\"/home/nvidia/host_pc_camera/Debug/host_pc_camera\"";exit
nvidia@tegra-ubuntu:~$ echo $PWD'>'
/home/nvidia>
nvidia@tegra-ubuntu:~$ /bin/sh -c "cd \"/home/nvidia/host_pc_camera/Debug\";export LD_LIBRARY_PATH=\"/usr/local/cuda-8.0/lib64\":\${LD_LIBRARY_PATH};\"/home/nvidia/host_pc_camera/Debug/host_pc_camera\"";exit

(host_pc_camera:21674): Gtk-WARNING **: cannot open display:
****** tcambin serial=19710151 ! video/x-raw,format=BGRx,width=640,height=480,framerate=30/1 ! videoconvert ! video/x-raw, format=BGR !appsinklogout


I added it:
setenv(“DISPLAY”, “:0”, 0);


But I have an error:
../camera.cpp:60:11: error: ‘int setenv’ redeclared as different kind of symbol
int setenv("DISPLAY", ":0", 0);
^
In file included from ../camera.cpp:4:0:
/usr/include/stdlib.h:584:12: note: previous declaration ‘int setenv(const char*, const char*, int)’
extern int setenv (const char *__name, const char *__value, int __replace)
^
subdir.mk:18: recipe for target 'camera.o' failed
make: Leaving directory '/home/nvidia/host_pc_camera/Debug'
make: *** [camera.o] Error 1
> Shell Completed (exit code = 2)

#1
Posted 11/22/2017 01:13 PM   
Hi,vvvarvolik You can erase " int setenv("DISPLAY", ":0", 0);" in your code firstly to make the build pass. Then you can configure the DISPLAY env in Run->Run Configurations->Environment. If "DISPLAY=:0 ./sample" can work directly on target side command line, I think remote run should be OK.
Hi,vvvarvolik

You can erase " int setenv("DISPLAY", ":0", 0);" in your code firstly to make the build pass.

Then you can configure the DISPLAY env in Run->Run Configurations->Environment.


If "DISPLAY=:0 ./sample" can work directly on target side command line, I think remote run should be OK.

#2
Posted 11/23/2017 02:38 AM   
I have an error: [code](host_pc_camera:3312): Gtk-WARNING **: cannot open display: 0 ****** tcambin serial=19710151 ! video/x-raw,format=BGRx,width=640,height=480,framerate=80/1 ! videoconvert ! video/x-raw, format=BGR !appsinklogout [/code]
I have an error:

(host_pc_camera:3312): Gtk-WARNING **: cannot open display: 0
****** tcambin serial=19710151 ! video/x-raw,format=BGRx,width=640,height=480,framerate=80/1 ! videoconvert ! video/x-raw, format=BGR !appsinklogout

#3
Posted 11/23/2017 07:58 AM   
Hi, vvvarvolik You should check in target side firstly. Is the X started ? Which user does the X belong to ? ps -ef|grep X to check
Hi, vvvarvolik

You should check in target side firstly.

Is the X started ? Which user does the X belong to ?

ps -ef|grep X to check

#4
Posted 11/23/2017 08:04 AM   
What is X? Can you explain step by step?
What is X?
Can you explain step by step?

#5
Posted 11/23/2017 08:20 AM   
You want to start UI on target side, right ? That need Xserver launched. 1) ps -ef|grep X to check if you get info like below nvidia@jetson-tx1:~$ ps -ef|grep X root 798 740 5 Nov21 tty7 02:43:20 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch 2) If not, you need start X by using "sudo service lightdm start" or others 3) Then please check below root@jetson-tx1:~# ls -l .Xauthority lrwxrwxrwx 1 root root 24 Nov 21 07:22 .Xauthority -> /home/nvidia/.Xauthority In this case, you can either use root or nvidia user name to set target system in Nsight EE
You want to start UI on target side, right ?

That need Xserver launched.

1) ps -ef|grep X to check if you get info like below

nvidia@jetson-tx1:~$ ps -ef|grep X
root 798 740 5 Nov21 tty7 02:43:20 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

2) If not, you need start X by using "sudo service lightdm start" or others

3) Then please check below

root@jetson-tx1:~# ls -l .Xauthority
lrwxrwxrwx 1 root root 24 Nov 21 07:22 .Xauthority -> /home/nvidia/.Xauthority

In this case, you can either use root or nvidia user name to set target system in Nsight EE

#6
Posted 11/23/2017 08:34 AM   
Suggest you launch the application from command line firstly to make sure it can work
Suggest you launch the application from command line firstly to make sure it can work

#7
Posted 11/23/2017 08:35 AM   
I have a project with two cameras, they are connected to Jetson TX2, I can start project from Jetson TX2 terminal but can not start with Nsight EE
I have a project with two cameras, they are connected to Jetson TX2, I can start project from Jetson TX2 terminal but can not start with Nsight EE

#8
Posted 11/23/2017 08:40 AM   
Then please check the command line generated in Nsight and compare the command line you used in Jetson TX2 to find the difference. There must be something wrong.
Then please check the command line generated in Nsight and compare the command line you used in Jetson TX2 to find the difference.


There must be something wrong.

#9
Posted 11/23/2017 08:44 AM   
At Jetson, I just open the project and do it. / Simple
At Jetson, I just open the project and do it. / Simple

#10
Posted 11/23/2017 08:50 AM   
Scroll To Top

Add Reply