As you say @SivaRamaKrishnaNV we need some “requires clean up” but we don’t know where. Then I tell you the steps done and the errors that I receive every time I run it
At the beginning:
CHECK_DW_ERROR(dwImage_create(&m_rgbCPU, cpu_prop, sdk));
CHECK_DW_ERROR(dwImage_create(&rgbCUDA16, cudaProp16, sdk));
dwImageCPU* imageCPU = nullptr;
CHECK_DW_ERROR(dwImage_getCPU(&imageCPU, m_rgbCPU));
uint32_t index_s;
std::vector<uint8_t> R;
std::vector<uint8_t> G;
std::vector<uint8_t> B;
for (uint32_t row = 0 ; row < image_.height ; row++) {
for (uint32_t col = 0 ; col < image_.width ; col++) {
index_s = 3*(row*image_.width+col);
R.push_back(image_.data[index_s+0]);
G.push_back(image_.data[index_s+1]);
B.push_back(image_.data[index_s+2]);
}
}
imageCPU->prop = cpu_prop;
imageCPU->data[0] = &R[0];
imageCPU->data[1] = &G[0];
imageCPU->data[2] = &B[0];
imageCPU->pitch[0] = image_.width;
imageCPU->pitch[1] = image_.width;
imageCPU->pitch[2] = image_.width;
dwImageCUDA* imageCUDA16 = nullptr;
CHECK_CUDA_ERROR(dwImage_getCUDA(&imageCUDA16, rgbCUDA16));
imageCUDA16->prop = cudaProp16;
And in the clean function:
CHECK_DW_ERROR(dwImage_destroy(m_rgbCPU));
CHECK_DW_ERROR(dwImage_destroy(rgbCUDA16));
But when I added
CHECK_DW_ERROR(dwImageStreamer_producerSend(m_rgbCPU, m_streamerCPU2CUDA));
CHECK_DW_ERROR(dwImageStreamer_consumerReceive(&rgbCUDA16, 2000, m_streamerCPU2CUDA));
The execution got have an error
free(): invalid pointer
So I added in the same funtion of clean:
CHECK_DW_ERROR(dwImageStreamer_consumerReturn(&rgbCUDA16, m_streamerCPU2CUDA));
CHECK_DW_ERROR(dwImageStreamer_producerReturn(&m_rgbCPU, 2000, m_streamerCPU2CUDA));
CHECK_DW_ERROR(dwImage_destroy(m_rgbCPU));
CHECK_DW_ERROR(dwImage_destroy(rgbCUDA16));
And I got that error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): [2021-08-09 20:11:06] DW Error DW_INVALID_HANDLE executing DW function:
dwImage_destroy(rgbCUDA16)
Then, I change by:
CHECK_DW_ERROR(dwImageStreamer_consumerReturn(&rgbCUDA16, m_streamerCPU2CUDA));
CHECK_DW_ERROR(dwImageStreamer_producerReturn(&m_rgbCPU, 2000, m_streamerCPU2CUDA));
(dwImage_destroy(m_rgbCPU));
(dwImage_destroy(rgbCUDA16));
And it runned during 7 minute then the memory is full and I got these error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): [2021-08-09 20:21:22] DW Error DW_FAILURE executing DW function:
dwImage_create(&rgbCUDA16, cudaProp16, sdk)
Right before returning that error, using nvidia-smi, I see Volatile GPU-Util between 5 - 7 % and the initial Memory-Usage was 678MiB / 3911MiB
±----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Quadro T2000 Off | 00000000:01:00.0 On | N/A |
| N/A 55C P0 14W / N/A | 3744MiB / 3911MiB | 5% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+
±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1342 G /usr/lib/xorg/Xorg 39MiB |
| 0 N/A N/A 1578 G /usr/bin/gnome-shell 73MiB |
| 0 N/A N/A 2209 G /usr/lib/xorg/Xorg 371MiB |
| 0 N/A N/A 2343 G /usr/bin/gnome-shell 63MiB |
| 0 N/A N/A 3327 G …AAAAAAAAA= --shared-files 22MiB |
| 0 N/A N/A 4144 G …AAAAAAAAA= --shared-files 77MiB |
| 0 N/A N/A 6069 G …AAAAAAAAA= --shared-files 25MiB |
| 0 N/A N/A 14560 C …ction/detection 3063MiB |
±----------------------------------------------------------------------------+
do you have any idea @VickNV or @SivaRamaKrishnaNV ?