CUDPP with OpenMP - Errors

9 views
Skip to first unread message

jph4599

unread,
Jul 29, 2009, 10:30:04 AM7/29/09
to 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 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.

Mark Harris

unread,
Jul 29, 2009, 5:49:15 PM7/29/09
to cu...@googlegroups.com
Hello,

Thanks for your report.  Can you file an official issue report at http://code.google.com/p/cudpp/issues/list, and attach to it a complete test application that exhibits the failures?  Since you are on windows, all the visual studio project files should be included in order that we can easily reproduce the errors.  

Since this is not a usage we have tested, I suspect there are just bugs in CUDPP that make it not thread safe, and we'd like to fix these bugs -- by providing an issue report and a test application you'll make it much easier to do that.

Cheers,
Mark

jph4599

unread,
Jul 29, 2009, 7:30:07 PM7/29/09
to CUDPP
Submitted: http://code.google.com/p/cudpp/issues/detail?id=32

On 29 July, 17:49, Mark Harris <harr...@gmail.com> wrote:
> Hello,
> Thanks for your report.  Can you file an official issue report athttp://code.google.com/p/cudpp/issues/list, and attach to it a complete test
> application that exhibits the failures?  Since you are on windows, all the
> visual studio project files should be included in order that we can easily
> reproduce the errors.
>
> Since this is not a usage we have tested, I suspect there are just bugs in
> CUDPP that make it not thread safe, and we'd like to fix these bugs -- by
> providing an issue report and a test application you'll make it much easier
> to do that.
>
> Cheers,
> Mark
>

Mark Harris

unread,
Jul 29, 2009, 7:46:54 PM7/29/09
to cu...@googlegroups.com
Thanks! 

Mark Harris

unread,
Nov 18, 2009, 8:57:53 PM11/18/09
to cu...@googlegroups.com
Hi jph4599,

My check-in from yesterday fixes CUDPP for use with OpenMP (well, at least your simple test works).  There is no official release yet with this fix, but if you are willing to check out the top-of-tree via anonymous SVN, you can try it out.

Note there are interface changes with this fix in order to make CUDPP thread-safe.  See the issue report and the updated samples.

Thanks,
Mark

Thanks! 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CUDPP" group.
To post to this group, send email to cu...@googlegroups.com
To unsubscribe from this group, send email to cudpp+un...@googlegroups.com
For more options, visit this group at http://groups.google.co.uk/group/cudpp?hl=en
-~----------~----~----~----~------~----~------~--~---



Reply all
Reply to author
Forward
0 new messages