Figuring out which value is the INVALID_VALUE when allocating from a pool

I’m issuing the call:

auto status = cuMemAllocFromPoolAsync(&dptr, num_bytes, my_pool_handle, my_stream_handle);

and am getting back CUDA_ERROR_INVALID_VALUE.

The out-param, so that’s not the problem; num_bytes is 67108864, and the pool and stream handles seem legit (they’re really pointers, so the values don’t mean much as such). How do I figure out which of the last three, or last two, are INVALID as far as CUDA is concerned?

I am notvery familiar with the driver API. I would check if stream and pool belong to the same device/context.
Does the pool’s context need to be the active context?

I’ll check. I don’t know about pool contexts though, I think pools might be “context-free”. The driver API doesn’t seem to mention context w.r.t. pools (unless I missed it somehow).

So, @striker159 : The stream and the pool belong to the same device. The stream was created in the device’s primary context, while the pool was created without mentioning a context (like I said, it doesn’t seem like pools are associated with contexts).