sample_stereo_camera_usb error

I am trying to use ZED stereo camera on a linux machine.
I encounter an error and don’t know why.
I use ZED’s calibration tool, generated a SN13676.conf file. Then I convert that file to rig.xml format manually.

camera_usb$ ./sample_stereo_camera_usb --rigconfig=/home/weizhe/zed_full.xml
ProgramArguments: Missing argument 'single-input' requested
Initialize DriveWorks SDK v0.6.67
Release build with GNU 4.8.5 from v0.6.0-rc7-0-g51bd3aa
TimeSource: monotonic epoch time offset is 1524553847800904
SDK: Resources mounted from /media/data/driveworks_06_samples/samples/../data/resources
SDK: number of GPU devices detected 1
SDK: currently selected GPU device discrete ID 0
SensorFactory::createSensor() -> camera.usb, device=0
VIDEOIO ERROR: V4L/V4L2: VIDIOC_S_CROP
VIDEOIO ERROR: V4L2: getting property #5 is not supported
Camera image: 1344x376
Camera image with 1344x376 at 30 FPS
Rectified image: 656x314
Driveworks exception thrown: DW_CUDA_ERROR: CudaTextureObjectCache::getOrCreateTextureObject : invalid argument

terminate called after throwing an instance of 'std::runtime_error'
  what():  DW Error DW_CUDA_ERROR executing DW function:
 dwStereoRectifier_rectify(&m_outputRectified[DW_STEREO_SIDE_LEFT], &m_outputRectified[DW_STEREO_SIDE_RIGHT], m_stereoImagesPtr[0], m_stereoImagesPtr[1], m_stereoRectifier)
 at /media/data/driveworks_06_samples/samples/src/stereo/camera/camera_usb/main.cpp:219
Aborted

Here is my zed_full.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<DRIVEWORKS ver="1.0">
 <VEHICLE>
  <PROPERTY Name="Height" Value="1.455"/>
  <PROPERTY Name="Length" Value="4.915"/>
  <PROPERTY Name="Width" Value="1.874"/>
  <PROPERTY Name="Wheelbase" Value="2.912"/>
  <PROPERTY Name="Front axlebase" Value="1.627"/>
  <PROPERTY Name="Rear axlebase" Value="1.618"/>
  <PROPERTY Name="Wheel diameter" Value="0.68"/>
  <PROPERTY Name="Distance axle to rear bumper" Value="1.1091"/>
  <PROPERTY Name="Distance axle to front bumper" Value="0.912"/>
  <PROPERTY Name="Steering coefficient" Value="14.8"/>
 </VEHICLE>
 <SENSORS>
  <CAMERA Name="left_60FOV" Type="virtual">
   <PROPERTY Name="Model" Value="pinhole"/>
   <PROPERTY Name="Quaternion" Value="-0.502356313198281 0.505835203694119 0.494153367922866 -0.49757545183022"/>
   <PROPERTY Name="Position" Value="0 0 1.5"/>
   <PROPERTY Name="params" Value=""/>
   <PROPERTY Hint="intrinsic" Name="width" Value="672"/>
   <PROPERTY Hint="intrinsic" Name="height" Value="376"/>
   <PROPERTY Hint="intrinsic" Name="distortion" Value="-0.16984 0.025845"/>
   <PROPERTY Hint="intrinsic" Name="cx" Value="348.989"/>
   <PROPERTY Hint="intrinsic" Name="cy" Value="196.999"/>
   <PROPERTY Hint="intrinsic" Name="fx" Value="349.828"/>
   <PROPERTY Hint="intrinsic" Name="fy" Value="349.828"/>
  </CAMERA>
  <CAMERA Name="right_60FOV" Type="virtual">
   <PROPERTY Name="Model" Value="pinhole"/>
   <PROPERTY Name="Quaternion" Value="-0.489103131305076 0.517455802889687 0.509255132043413 -0.48340131308345"/>
   <PROPERTY Name="Position" Value="0 -0.119964 1.5"/>
   <PROPERTY Name="params" Value=""/>
   <PROPERTY Hint="intrinsic" Name="width" Value="672"/>
   <PROPERTY Hint="intrinsic" Name="height" Value="376"/>
   <PROPERTY Hint="intrinsic" Name="distortion" Value="-0.168846 0.0252048"/>
   <PROPERTY Hint="intrinsic" Name="cx" Value="344.535"/>
   <PROPERTY Hint="intrinsic" Name="cy" Value="196.991"/>
   <PROPERTY Hint="intrinsic" Name="fx" Value="349.819"/>
   <PROPERTY Hint="intrinsic" Name="fy" Value="349.819"/>
  </CAMERA>
 </SENSORS>
 <CALIBRATION>
  <EXTRINSIC_CAMERA>
   <PROPERTY Name="masterCameraRearAxleCenterX" Value="3.47"/>
   <PROPERTY Name="masterCameraRearAxleCenterY" Value="0"/>
   <PROPERTY Name="markerVerticalHeight" Value="0"/>
   <PROPERTY Name="unitSize" Value="0.051"/>
  </EXTRINSIC_CAMERA>
 </CALIBRATION>
</DRIVEWORKS>

BTW, I have to modify the code

bool StereoApp::onInitialize()
{
    if (m_inputTypeCamera) {
        // for now assume ZED camera (side-by-side images)
        m_stereoCamera[0] = initFromCamera();

        m_imageProperties.width = m_stereoCamera[0]->getImageProperties().width / 2;
        m_imageProperties.height = m_stereoCamera[0]->getImageProperties().height / 2;
    }

by commenting the “heigh/2” line. Is it an err? Why height need to divided by 2?

Can any one check the code?
Why err when dwStereoRectifier_rectify?

Driveworks exception thrown: DW_CUDA_ERROR: CudaTextureObjectCache::getOrCreateTextureObject : invalid argument

The document says it support ZED camera, but the sample can NOT run!

Dear sarveshd,

Could you file a bug for your topic with detail description? We will look into it.
Please login to https://developer.nvidia.com/drive with your credentials. Please check MyAccount->MyBugs->Submit a new bug to file bug.
Please share ID here to follow up. Thanks.

I changed the code in stereoCommon.cpp:

dwImageCUDA_mapToROI(gStereoImages[0], stereoFrame, roi[0]);
dwImageCUDA_mapToROI(gStereoImages[1], stereoFrame, roi[1]);

to:

dwImageCUDA tmpImage1, tmpImage2;
CHECK_DW_ERROR(dwImageCUDA_mapToROI(&tmpImage1, stereoFrame, roi[0]));
dwImageFormatConverter_copyConvertCUDA(gStereoImages[0], &tmpImage1, m_copy, 0);
        
CHECK_DW_ERROR(dwImageCUDA_mapToROI(&tmpImage2, stereoFrame, roi[1]));
dwImageFormatConverter_copyConvertCUDA(gStereoImages[1], &tmpImage2, m_copy, 0);

The rectify using camera works now.
Seems I have to copy the two side by side images, instead of just map two ROI.
Is it a bug of driveworks?