Is there a cudaGetErrorString() equivalent for driver error codes?

Is there any equivalent function to cudaGetErrorString(), that works for CUresult codes from cuXXX() calls?

I can’t find it in the documentation. I’m using CUDA 2.1 on XP.


There isn’t, as far as I know, however cudaGetErrorString should work with driver API return codes as well - the underlying enumerated type is the same (of course it means you need to link with cudart, which you may or may not want to do).

Thanks for the reply.

Are you possibly referencing a later version than 2.1? Because my observations don’t match what you said.

  1. CUresult is a different type from cudaError_t

  2. I’ve tried passing CUresults to cudaGetErrorString with a cast and they all come back “unknown driver code”

  3. I’ve also passed cudaError_t values that are really driver values (offset by cudaErrorApiFailureBase) to cudaGetErrorString (after subtracting cudaErrorApiFailureBase) and they all come back “unknown driver code”.

  4. The two sets of values conflict in the 1 - 5 range.

OK I just went back and checked the definitions, and I was wrong, they are different. I had it in my head that the underlying enum was the same in both cases (probably the one time I didn’t check the documentation before posting). So forget I ever commented…