recorder-tui error

Hi,
I follow the camera calibration tutorials instructions to do Intrinsic calibration only (file:///usr/local/driveworks-1.2/doc/nvdwx_html/dwx_camera_calibration.html).

As the first step describes, I need to record the camera video and use the recorder-tui in tools.
But I run the recorder with below error:
https://drive.google.com/open?id=1CerorJGZAWYMhV5bd40WMHh9jGukROnU

My camera type is ar0231-rccb-bae-sf3324, and I can see the image by running any gmsl camera sample.
https://drive.google.com/open?id=14ZsJmpZPvgjOYNo7ub3_wIjnFxgfZuzu
Please help solve this error, thanks.

Below is the rig json that I referenced from this post(https://devtalk.nvidia.com/default/topic/1042871/general/error-recording-camera-h264-solved-/post/5298375/#5298375)

{
    "rig": {
        "sensors": [
            {
                "name": "camera_capture_test",
                "nominalSensor2Rig": {
                    "quaternion": [
                        0.5,
                        -0.5,
                        0.5,
                        -0.5
                    ],
                    "t": [
                        1.77,
                        0.0,
                        1.47
                    ]
                },
                "parameter": "camera-type=ar0231-rccb-bae-sf3324,csi-port=a,camera-count=4,camera-mask=0010,format=h264,output-format=yuv,fifo-size=30",
                "properties": {
                    "Model": "ftheta",
                    "bw-poly": "0.0 0.00102669443003833 3.77865596590254e-08 -2.1812513600894e-11 4.76916107246175e-14",
                    "cx": "960",
                    "cy": "604",
                    "height": "1208",
                    "width": "1928"
                },
                "protocol": "camera.gmsl",
                "sensor2Rig": {
                    "quaternion": [
                        0.5,
                        -0.5,
                        0.5,
                        -0.5
                    ],
                    "t": [
                        1.77,
                        0.0,
                        1.47
                    ]
                }
            }

        ],
        "vehicle": {
            "valid": true,
            "value": {
                "COMMENT": "steeringCoefficient is not validated",
                "axlebaseFront": 1.582,
                "axlebaseRear": 1.575,
                "bumperFront": 0.912,
                "bumperRear": 1.109,
                "centerOfMassToRearAxle": 1.564,
                "frontCorneringStiffness": 30654.0,
                "height": 1.473,
                "inertia": 1780.8,
                "length": 4.872,
                "mass": 1779.4,
                "rearCorneringStiffness": 36407.0,
                "steeringCoefficient": 14.8,
                "wheelDiameter": 0.673,
                "wheelbase": 2.85,
                "width": 1.852,
                "widthWithMirrors": 2.121
            }
        }
    },
    "version": 2
}

Hi cyan.chiu

Could you please check and try to run below items?

-. Could you please help to check the HDD file format if ext4 or not?
-. Power off Drive PX2 and power on Drive PX2 after 1 min
-. Run “export CUDA_VISIBLE_DEVICES=0” for dGPU before the recoder-tui tool

Thanks

Dear kayccc,
Below is the checks:

  1. My px2 file is flashed by sdkmanager, and the file format is as below, its ext4.
    [url]https://drive.google.com/open?id=1XmAW15_le7jWGMRbfzX9WRhrS26JI1dC[/url]

  2. Power on/off can’t help since I stuck in this issue for days.

  3. I don’t have any dGPU for PX2, but I tried the export CUDA_VISIBLE_DEVICES=0 or 1 both before run
    recorder-tui, it can’t help me.

For the error “could not create NvMedia image stream producer”, could you give me information about what streamer type reocrder-tui transfer to(DW_IMAGE_GL?), so I can write some sample to test the streamer initialize, and report more detail logs.

Dear cyan.chiu,

According to the log, you have 4 cameras but mask option is only one.
If you have 1 camera, please try it with 1 camera mask option like below in the rig file.
camera-type=ar0231-rccb-bae-sf3324,csi-port=a,camera-count=1,camera-mask=0001,format=h264,output-format=yuv,fifo-size=30

If you have 2 cameras, please try it with 2 camera mask option like below.

  1. camera-type=ar0231-rccb-bae-sf3324,csi-port=a,camera-count=2,camera-mask=0011,siblingIndex=0,async-record=1,format=h264,output-format=yuv,fifo-size=30

  2. camera-type=ar0231-rccb-bae-sf3324,csi-port=a,camera-count=2,camera-mask=0011,siblingIndex=1,async-record=1,format=h264,output-format=yuv,fifo-size=30

Dear SteveNV,
I removed cameras and only plug one at port-a-0 as video. And I checked it workable by sample_camera_gmsl.
But when I run recorder-tui with the config as you said. I still got the “could not create nvmedia image stream producer” error as the video:
[url]https://drive.google.com/open?id=1Vi517JW3KFhSmWlcODfpyLjihvdOqfzN[/url]

Dear SteveNV,
Since I see the sample_image_streamer_cross use the nvmedia to gl streamer, I just try this sample and it workable as below image:
[url]https://drive.google.com/open?id=12zUGShq-Yg3OsWMyH4WVvZNbNFu1qgL9[/url]

My px2 should be ready to run the streamer and camera output, but the streamer created fail at recorder-tui.
If you have any idea about whats wrong with my rig json configuration?

Dear cyan.chiu,

According to the log you provided, recorder-tui is abruptly exited and forcibly exited.
So could you please refer to below step?

  1. Power off Drive PX2 and power on Drive PX2 after 1 min
    2.Run “export CUDA_VISIBLE_DEVICES=0” for dGPU before the recoder-tui tool

I could record data using recorder-tui with below configuration.
“parameter”: “camera-type=ar0231-rccb-bae-sf3325,csi-port=a,camera-count=1,camera-mask=0001,siblingIndex=0,async-record=1,format=lraw,output-format=raw+yuv,fifo-size=30”,

Dear SteveNV,
For the suggestion 1, I try the first power off/on, and the error is the same.
For the suggestion 2, I think I uses the iGPU and this command doesn’t fix the error.

I modify the rig config as you suggestion, but the same error occurs.
Please help check the config, or I have other ways to record the gmsl camera video for intrinsic calibration?
:

{
    "rig": {
        "sensors": [
            {
                "name": "camera_capture_test",
                "nominalSensor2Rig": {
                    "quaternion": [
                        0.5,
                        -0.5,
                        0.5,
                        -0.5
                    ],
                    "t": [
                        1.77,
                        0.0,
                        1.47
                    ]
                },
                "parameter": "camera-type=ar0231-rccb-bae-sf3324,csi-port=a,camera-count=1,camera-mask=0001,siblingIndex=0,async-record=1,format=lraw,output-format=raw+yuv,fifo-size=30",
                "properties": {
                    "Model": "ftheta",
                    "bw-poly": "0.0 0.00102669443003833 3.77865596590254e-08 -2.1812513600894e-11 4.76916107246175e-14",
                    "cx": "960",
                    "cy": "604",
                    "height": "1208",
                    "width": "1920"
                },
                "protocol": "camera.gmsl",
                "sensor2Rig": {
                    "quaternion": [
                        0.5,
                        -0.5,
                        0.5,
                        -0.5
                    ],
                    "t": [
                        1.77,
                        0.0,
                        1.47
                    ]
                }
            }

        ],
        "vehicle": {
            "valid": true,
            "value": {
                "COMMENT": "steeringCoefficient is not validated",
                "axlebaseFront": 1.582,
                "axlebaseRear": 1.575,
                "bumperFront": 0.912,
                "bumperRear": 1.109,
                "centerOfMassToRearAxle": 1.564,
                "frontCorneringStiffness": 30654.0,
                "height": 1.473,
                "inertia": 1780.8,
                "length": 4.872,
                "mass": 1779.4,
                "rearCorneringStiffness": 36407.0,
                "steeringCoefficient": 14.8,
                "wheelDiameter": 0.673,
                "wheelbase": 2.85,
                "width": 1.852,
                "widthWithMirrors": 2.121
            }
        }
    },
    "version": 2
}

Dear cyan.chiu,

It’s weird.
Could you please help check if nvmedia sample run on the DPX2 or not?

$cd drive-t186ref-linux/samples/nvmedia/img_cap
$export DISPLAY=:0
$./nvmimg_cap -cf drive-px2-a.conf -c dvp-ar0231-rccb-raw12-1920x1208-ab -d 0 -w 1

This is my rig config file. Could you please try to run the capture tool with the rig config file?

{
    "rig": {
        "sensors": [
            {
                "name": "camera:front:center:100fov",
                "nominalSensor2Rig": {
                    "quaternion": [
                        0.5,
                        -0.5,
                        0.5,
                        -0.5
                    ],
                    "t": [
                        1.77,
                        0.0,
                        1.47
                    ]
                },
                "parameter": "camera-type=ar0231-rccb-bae-sf3325,csi-port=a,camera-count=1,camera-mask=0001,siblingIndex=0,async-record=1,format=lraw,output-format=raw+yuv,fifo-size=30",
                "properties": {
                    "Model": "ftheta",
                    "bw-poly": "0.0 0.00102669443003833 3.77865596590254e-08 -2.1812513600894e-11 4.76916107246175e-14",
                    "cx": "960",
                    "cy": "604",
                    "height": "1208",
                    "width": "1920"
                },
                "protocol": "camera.gmsl",
                "sensor2Rig": {
                    "quaternion": [
                        0.5,
                        -0.5,
                        0.5,
                        -0.5
                    ],
                    "t": [
                        1.77,
                        0.0,
                        1.47
                    ]
                }
            }

          ],
        "vehicle": {
            "valid": true,
            "value": {
                "COMMENT": "steeringCoefficient is not validated",
                "axlebaseFront": 1.582,
                "axlebaseRear": 1.575,
                "bumperFront": 0.912,
                "bumperRear": 1.109,
                "centerOfMassToRearAxle": 1.564,
                "frontCorneringStiffness": 30654.0,
                "height": 1.473,
                "inertia": 1780.8,
                "length": 4.872,
                "mass": 1779.4,
                "rearCorneringStiffness": 36407.0,
                "steeringCoefficient": 14.8,
                "wheelDiameter": 0.673,
                "wheelbase": 2.85,
                "width": 1.852,
                "widthWithMirrors": 2.121
            }
        }
    },
    "version": 2
}

Dear SteveNV,
This issue is solved, thanks for your information.

I found the streamer error is caused by NvMediaEglStreamWrapperInitializeEgl.
I search this error found that I should add below string at /etc/environment:

PATH="/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
LD_LIBRARY_PATH="/usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/lib:/usr/local/cuda/targets/aarch64-linux/lib:/usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/lib:/usr/local/cuda/targets/aarch64-linux/lib:"

Besides, the output file will created at current folder, so don’t execute under root folder(/usr/local/driveworks/tool/capture). I can record h264 video by original rig config now.

Dear cyan.chiu,

Thank you for your update.
It seems that you didn’t CUDA setup on DrivePX2.
Could you please refer to below for CUDA setting and how to check iGPU/dGPU information?

<b>CUDA setting.</b>
$gedit ~/.bashrc
export PATH=/usr/local/cuda-9.2/bin/:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/targets/aarch64-linux/lib:$LD_LIBRARY_PATH

$ source ~/.bashrc 
$ nvcc --version

$/usr/local/cuda-10.0/bin/cuda-install-samples-10.0.sh ~/

$cd ~/NVIDIA_CUDA10.0_Samples/1_Utilities/deviceQuery
$make
$./deviceQuery

The capture tool can discover SSD/eSATA disks that are mounted on the target and automatically selects the first available disk for recording. Thanks.

Dear SteveNV,
I can do the deviceQuery and bandwidthTest on PX2 before, so I don’t know my cuda is not correctly setup after sdkmanager flashed.

Thanks for your setting guide, I try and its workable by adding below on my bashrc, dont need to modify /etc/environment:

export LD_LIBRARY_PATH=/usr/lib:/usr/local/cuda/targets/aarch64-linux/lib:$LD_LIBRARY_PATH

Below is my deviceQuery information:

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "NVIDIA Tegra X2"
  CUDA Driver Version / Runtime Version          9.2 / 9.2
  CUDA Capability Major/Minor version number:    6.2
  Total amount of global memory:                 6402 MBytes (6712545280 bytes)
  ( 2) Multiprocessors, (128) CUDA Cores/MP:     256 CUDA Cores
  GPU Max Clock rate:                            1275 MHz (1.27 GHz)
  Memory Clock rate:                             1600 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 524288 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 32768
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            Yes
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 0 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.2, CUDA Runtime Version = 9.2, NumDevs = 1
Result = PASS

Dear cyan.chiu,

Please setup CUDA_VISIBLE_DEVICES=0,1 and then try to re-run deviceQuery.
Maybe you can get below message. Thanks.

root@tegra-ubuntu:~/NVIDIA_CUDA-9.2_Samples/1_Utilities/deviceQuery# export CUDA_VISIBLE_DEVICES=0,1
root@tegra-ubuntu:~/NVIDIA_CUDA-9.2_Samples/1_Utilities/deviceQuery# ./deviceQuery
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 2 CUDA Capable device(s)

Device 0: "DRIVE PX 2 AutoChauffeur"
  CUDA Driver Version / Runtime Version          9.2 / 9.2
  CUDA Capability Major/Minor version number:    6.1
  Total amount of global memory:                 3840 MBytes (4026466304 bytes)
  ( 9) Multiprocessors, (128) CUDA Cores/MP:     1152 CUDA Cores
  GPU Max Clock rate:                            1290 MHz (1.29 GHz)
  Memory Clock rate:                             3003 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 1048576 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 2 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 4 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

Device 1: "NVIDIA Tegra X2"
  CUDA Driver Version / Runtime Version          9.2 / 9.2
  CUDA Capability Major/Minor version number:    6.2
  Total amount of global memory:                 6402 MBytes (6712545280 bytes)
  ( 2) Multiprocessors, (128) CUDA Cores/MP:     256 CUDA Cores
  GPU Max Clock rate:                            1275 MHz (1.27 GHz)
  Memory Clock rate:                             1600 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 524288 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 32768
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            Yes
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 0 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
> Peer access from DRIVE PX 2 AutoChauffeur (GPU0) -> NVIDIA Tegra X2 (GPU1) : No
> Peer access from NVIDIA Tegra X2 (GPU1) -> DRIVE PX 2 AutoChauffeur (GPU0) : No

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.2, CUDA Runtime Version = 9.2, NumDevs = 2
Result = PASS
root@tegra-ubuntu:~/NVIDIA_CUDA-9.2_Samples/1_Utilities/deviceQuery#

Dear SteveNV,
Follow the setting

export CUDA_VISIBLE_DEVICES=0,1

I can get the same result(2 devices) as yours now.
Thanks for your information make me know the two gpu usage.