Trying to run the embedded code example from Matlab on the Jetson TX2

Hello,

I am trying to run the example from this link:
https://www.mathworks.com/help/gpucoder/examples/running-an-embedded-application-on-the-nvidia-r-jetson-tx2-developer-kit.html

On my TX2 board. When I finally do go to run it I get these errors:

nvidia@tegra-ubuntu:~/Desktop/codegen/lib/alexnet_predict$ ./alexnet_exe /dev/video1
VIDEOIO ERROR: libv4l unable convert to requested pixfmt
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT

OpenCV(3.4.1-dev) Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /home/nvidia/opencv/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

OpenCV(3.4.1-dev) /home/nvidia/opencv/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
in function cvCaptureFromCAM_GStreamer

Could not open the video capture device.

I have not been able to find anything helpful with troubleshooting this problem. I was wondering if anyone else has run into this issue?

It sounds like their GStreamer pipeline is misconfigured for the camera. Are you using JetPack 3.2? Have you contacted Mathworks support about it?

Yes I am using JetPack 3.2, and I installed opencv as per the instructions I found on another thread to have GStreamer on and configured.

The thread is here: https://devtalk.nvidia.com/default/topic/1020915/opencv-and-webcam-problem-pixel-format-of-incoming-image-is-unsupported-by-opencv/

Do you have a USB camera with /dev/video1 appearing a few seconds after you plug it in ?

Yes, I am using the logitech C920 webcam.

Also, I tried running this command as per the Mathworks tutorial and this is the error I got with it:

nvidia@tegra-ubuntu:~/Desktop/codegen/lib/alexnet_predict$ ./alexnet_exe 1

CUDNN_STATUS_BAD_PARAM, line: 168, file: MWCNNLayerImpl.cu

Hi,

There are different error shared in comment #1 and comment #5.
Have you fixed the openCV error already?

For the CUDNN_STATUS_BAD_PARAM, it is usually casued by incompatible driver and libraries.

Suppose you are following this tutorial from mathworks:
https://nl.mathworks.com/help/gpucoder/examples/running-an-embedded-application-on-the-nvidia-r-jetson-tx2-developer-kit.html

It is set up with cuDNN 5.0 and the nearest JetPack version should be 3.0 which includes cuDNN 5.1:
https://developer.nvidia.com/embedded/jetpack-3_0

Thanks.