Libargus Sample V4L2CUDA does not run and debugging also makes problems

Hi,
I am using the NVIDIA Jetson nano and trying to run the following sample:
Jetson Linux API Reference: v4l2cuda (CUDA format conversion) | NVIDIA Docs

At the moment the following error is occurring:

nvnano@nvnano-desktop:/usr/src/jetson_multimedia_api/samples/v4l2cuda$ ./capture-cuda -d /dev/video1 -m
select timeout
nvnano@nvnano-desktop:/usr/src/jetson_multimedia_api/samples/v4l2cuda$

Therefore I opened Visual Studio Code to debug via ssh. First I have installed Nsight Visual Studio Code and set up the task.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "CUDA Make",
            "type": "shell",
            "command": "make dbg=1",
            "group": "build",
            "problemMatcher": [
                "$nvcc"
            ]
        }
    ]
}

and the launch.json:

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "CUDA: Debug with CUDA-GDB",
            "type": "cuda-gdb",
            "request": "launch",
            "debuggerPath": "/usr/local/cuda/bin/cuda-gdb",
            "program": "${workspaceFolder}/capture-cuda",
            "args": "",
        }
    ]
}

When I start debugging via “F5” the following error occurs:

NVIDIA (R) CUDA Debugger
10.2 release
Portions Copyright (C) 2007-2020 NVIDIA Corporation
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-elf-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
fatal:  The CUDA driver initialization failed. (error code = CUDBG_ERROR_INITIALIZATION_FAILURE(0x14)

How can I solve the CUDA driver initialization problem therewith I debug the select timeout problem from above? Does anybody of you has the right configuration for tasks.json and launch.json to debug the capture.cpp and yuv2rgb.cu simultaneously?
Thank you for your help in advance.

What’s your sensor output format?
This sample only working for YUV sensor. Please check with v4l2-ctl --all

Hi,
thank you for the answer. This is the result of the demanded command:

Driver Info (not using libv4l2):
	Driver name   : tegra-video
	Card type     : vi-output, vc_mipi 6-001a
	Bus info      : platform:54080000.vi:0
	Driver version: 4.9.253
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 0: no power)
Format Video Capture:
	Width/Height      : 5440/3648
	Pixel Format      : 'GREY'
	Field             : None
	Bytes per Line    : 5440
	Size Image        : 19845120
	Colorspace        : Raw
	Transfer Function : Default (maps to None)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 

Camera Controls

                     group_hold 0x009a2003 (bool)   : default=0 value=0 flags=execute-on-write
                    sensor_mode 0x009a2008 (int64)  : min=0 max=0 step=0 default=0 value=0 flags=slider
                           gain 0x009a2009 (int64)  : min=0 max=0 step=0 default=0 value=1 flags=slider
                       exposure 0x009a200a (int64)  : min=0 max=0 step=0 default=0 value=1000000 flags=slider
                     frame_rate 0x009a200b (int64)  : min=0 max=0 step=0 default=0 value=1 flags=slider
                   trigger_mode 0x009a200e (int64)  : min=0 max=0 step=0 default=0 value=0 flags=slider
                     flash_mode 0x009a200f (int64)  : min=0 max=0 step=0 default=0 value=0 flags=slider
                    black_level 0x009a2010 (int64)  : min=0 max=0 step=0 default=0 value=0 flags=slider
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
               write_isp_format 0x009a2068 (bool)   : default=0 value=0
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=1 flags=read-only

These are my devices:

nvnano@nvnano-desktop:~$ v4l2-ctl --list-devices
vi-output, vc_mipi 6-001a (platform:54080000.vi:0):
	/dev/video0

vi-output, vc_mipi 0-001a (platform:54080000.vi:2):
	/dev/video1

My pixel format is grey. Anyway I want to edit this example to make it run with two CSI cameras. Therefore I need the right debugging set up in Visual Studio Code. Could you help me with that set up or would you take another example for editing? In general my goal is to capture two images one each camera simultaneously and transfer it to another PC in the network via Ethernet. The picture shall be saved in .RAW format.

Try capture-cuda -d /dev/video1 -m -f Y8
Sorry, I don’t have experience about VC.

Did you confirm by v4l2-ctl to confirm the sensor driver and HW without problem?
You can use v4l2src to setup RTSP to transfer the frame to Ethernet.

The command is not found:

nvnano@nvnano-desktop:~$ capture-cuda -d /dev/video1 -m -f Y8
-bash: capture-cuda: command not found

Additionally, I want to implement a small image processing. Therefore I do need a code base. Do you have some available?
Yes I confirmed it by the following command:

  v4l2-ctl --set-fmt-video=pixelformat=RG10,width=5440,height=3648

You should streaming by v4l2-ctl, And ./capture-cuda -d /dev/video1 -m -f Y8

v4l2-ctl --set-fmt-video=pixelformat=RG10,width=5440,height=3648 --stream-mmap

I don’t want to stream. Do you have a colleague who can help me how to realize my goal which I have mentioned above or which documentations I should read?

You need to streaming to confirm the functionality.
Will check if any document to VS.

Did you install CUDA on your host?
Have a check below topic.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.