Launch python program at startup ( jetson TX2)

Hi!

I would like to launch a python program that uses GPU, CUDA, USB Camera, conv neural networks,… at startup. I tried to add the command to ‘Startup applications’: /bin/bash -c “sleep 15 && python3 /home/nvidia/program.py” but it doesn’t work.

What can I do?

Thank you!
Quentin

Hi,

Could you share the error message with us?

Which interface do you use for camera? is it OpenCV?
If yes, please noticed that our default OpenCV package doesn’t enableGStreamer support.
You will need to re-build it from source:
https://github.com/AastaNV/JEP/tree/master/script

Thanks.

Thank you for your answer. I don’t get any error message, but the program doesn’t start at the startup of the tx2.

Yes, i use OpenCV but the program work perfectly when running on terminal. ( I installed another version of opencv )

Thank you,
Quentin

Hi,

Could you try if the python part works first?

python3 /home/nvidia/program.py

Thanks.

Yes, it works.

Regards,

Sorry, what I meant is that the command works on terminal but it doesn’t work if put on the « startup applications »: nothing still shows up at startup ».
So the problem isn’t resolved. Sorry for the confusion with my last message.
Best regards,

Hi,

Is it the application contains a user interface?
It may terminate without issue if fail to create X server.

Thanks.

I meet the same question, the program contains a user interface, it shows the frame of the camera. Then how to solve the problem?

Hi tianyi98324,

Please open a new topic for your issue, be sure to update with those SW version information clearly.

Thanks

I have opened a new topic about this.

Topic:OpenCV window python program to autostart on Startup

https://devtalk.nvidia.com/default/topic/1070961/jetson-nano/opencv-window-python-program-to-autostart-on-startup/post/5425650/#5425650