CUDPP Scan with OpenMP Errors

I also posted this message on the CUDPP Google Group but it does not look very active and I’m hoping someone on the CUDA forums may have some additional experience with CUDPP.

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/Release 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.

I have also received an assertion originating at CUDPPPlanManager::GetPlan line 130 during cudppScan.

And last but not least, cudppPlan sometimes fails with CUDPP_ERROR_UNKNOWN.

The code I am using for the scan is:

[codebox]

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”);

}

[/codebox]

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.

I have a similar problem with OpenMP and cudpp, using Cuda 2.3 on x64.

With one thread (one GPU) all works well.
With two threads (Two GPU’s) cudpp plan generation fails with CUDPP_ERROR_UNKNOWN.

Any help would be welcome

Mark Harris replied to my post:

I am working on zipping up an example project right now. I will post the link to the bug report once complete.

Edit: [Link to the bug report] If you have another example, it may be beneficial to also post that.

Thanks for the info, good to know that it will be worked upon.