I am attempting to use CUDPP scan in an OpenMP Multi-GPU project I am
working on. I currently have CUDA 2.3 beta installed on a Windows XP
32 bit system with a GTX 295.
CUDPP scan was working perfect when I was working with a single GTX
285 but since moving to OpenMP to exploit both GPUs of the GTX 295, I
continue to get errors when running on the device in Debug mode.
The first error I have seen is an unhandled exception on line 293 of
scan_app.cu when calling cudppDestroyPlan after performing the scan.
cudppPlan and cudppScan both return CUDPP_SUCCESS when this happens.
"Unhandled exception at 0x010189ec (cudpp32d.dll) in ViolaFinal.exe:
0xC0000005: Access violation reading location 0xfeeefef2."
I have also received an assertion originating at
CUDPPPlanManager::GetPlan line 130 during cudppScan.
"%program files%\microsoft visual studio 9.0\vc\include\xtree Line 304
- Expression: map/set iterators incompatible"
And last but not least, cudppPlan sometimes fails with
CUDPP_ERROR_UNKNOWN.
The code I am using for the scan is:
================================= [ CODE ]
===================================
CUDPPConfiguration cudppConfig;
CUDPPResult result;
cudppConfig.op = CUDPP_ADD;
cudppConfig.datatype = CUDPP_INT;
cudppConfig.algorithm = CUDPP_SCAN;
cudppConfig.options = CUDPP_OPTION_FORWARD |
CUDPP_OPTION_EXCLUSIVE;
CUDPPHandle scanplan = 0;
result = cudppPlan(&scanplan, cudppConfig, numTestPoints, 1, 0);
if (CUDPP_SUCCESS != result)
{
printf("Error creating CUDPPPlan for scan");
if( result == CUDPP_ERROR_INVALID_HANDLE )
printf(" - CUDPP_ERROR_INVALID_HANDLE\n");
else if( result == CUDPP_ERROR_ILLEGAL_CONFIGURATION )
printf(" - CUDPP_ERROR_ILLEGAL_CONFIGURATION\n");
else
printf(" - CUDPP_ERROR_UNKNOWN\n");
error("Failed to create CUDPPPlan for scan");
}
result = cudppScan(scanplan, d_streamScanOut, d_stageClassOut,
numTestPoints);
if (CUDPP_SUCCESS != result)
{
printf("cudppScan failed");
if( result == CUDPP_ERROR_INVALID_HANDLE )
printf(" - CUDPP_ERROR_INVALID_HANDLE\n");
else if( result == CUDPP_ERROR_ILLEGAL_CONFIGURATION )
printf(" - CUDPP_ERROR_ILLEGAL_CONFIGURATION\n");
else
printf(" - CUDPP_ERROR_UNKNOWN\n");
error("cudppScan failed");
}
result = cudppDestroyPlan(scanplan);
if (CUDPP_SUCCESS != result)
{
printf("cudppDestroyPlan failed");
if( result == CUDPP_ERROR_INVALID_HANDLE )
printf(" - CUDPP_ERROR_INVALID_HANDLE\n");
else if( result == CUDPP_ERROR_ILLEGAL_CONFIGURATION )
printf(" - CUDPP_ERROR_ILLEGAL_CONFIGURATION\n");
else
printf(" - CUDPP_ERROR_UNKNOWN\n");
error("cudppDestroyPlan failed");
}
================================= [ /CODE ]
===================================
Where:
- numTestPoints can range anywhere from 1 to 5400.
- d_streamScanOut and d_stageClassOut are allocated on the GPU by each
host thread with sufficient size
- I check for errors on all earlier CUDA calls.
The above code is in a function that is called from within a "#pragma
omp parallel" OpenMP block so each host thread should create its own
local copies of the variables. The devices are set and contexts
created once at the start of the application and a printf after the
"#pragma omp parallel" verifies that the host threads are using the
proper devices.
I have tried recompiling CUDPP and my application. I have also tried
restarting my machine but the same behavior keeps appearing.
I have not been able to track down what is causing these error so I
was hoping someone may have some additional advice.
Thank you for the assistance.