What size is being reported back? If it’s somewhat larger than expected, the buffer probably got bumped up to some alignment constraint when it was allocated. This is not concerning, the interop should still work.
For anyone interested, here is the solution to the bug in cuGLMapBufferObject() that I reported several days ago. The fact that I got no responses indicates that very few people use the driver API, and even fewer interact such codes with GL. In any case, I simply wrote a mapping routine with the standard API (cudaxxx):
template <class T>
T* mapBufferObject(T* ptr, unsigned int vbo)
CUDA_SAFE_CALL(cudaGLMapBufferObject((void**) &dptr, vbo));
To use from the driver API, simply execute:
CUdeviceptr dev = (CUdeviceptr) mapBufferObject(float*4 ptr, vbo)
This works because CUdeviceptr is actually typedef’ed to an unsigned int, which clearly suggests that it is actually the pointer to the data we are interested in. In any case, this approach allowed me to solve my problem.
It would however be nice if the people at NVidia could respond as to whether the Driver API routine is functioning as expected by providing some example code. There is none in the various projects.