Hidden Overloads in the CUDA Driver API

We recently hit an issue with a system at work which manually linked against the CUDA driver API at runtime. One function used to retrieve the memory limit of the GPU was always returning a 32 bit value even if the card had >4GB of VRAM and we were passing a 64 bit integer. On further investigation through forums we discovered the function originally took a 32bit integer and there was a newer version with the same name.

After lots of searching we found mention of an old API with the same name, just different parameters. That led to a check of the exported symbols and discovery of a “v2” function. Using that name led to the correct behaviour with our existing code.

As far as I could see this isn’t documented in any official location, and the functions are exposed in the header using their original name.