cuDeviceTotalMem (32 bit memory size limitation) CUDA Driver API

Hello,

I noticed the returned variables in the call to cuDeviceTotalMem are actually integers (32 bits).

This will probably create some problems soon as graphics cards go over 4 GB in ram ?!?

A 64 bit integer version would have been better, but I guess it can still be made and simply added… the sooner the better me thinks ;)

Another solution could be to pass in a value like:

0 for bytes
1 for kilobytes
2 for megabytes
3 for gigabytes
4 for terrabytes

And so forth… the api would then return the requested kwantity.

A little drawback is slight to severe rounding/truncating ;) so a 64 bit version would still be more precise.

Bye,
Skybuck.

Hello,

I noticed the returned variables in the call to cuDeviceTotalMem are actually integers (32 bits).

This will probably create some problems soon as graphics cards go over 4 GB in ram ?!?

A 64 bit integer version would have been better, but I guess it can still be made and simply added… the sooner the better me thinks ;)

Another solution could be to pass in a value like:

0 for bytes
1 for kilobytes
2 for megabytes
3 for gigabytes
4 for terrabytes

And so forth… the api would then return the requested kwantity.

A little drawback is slight to severe rounding/truncating ;) so a 64 bit version would still be more precise.

Bye,
Skybuck.

it’s not 32-bit in CUDA 3.2+

it’s not 32-bit in CUDA 3.2+

I’ll have to disagree with that… I am using CUDA Toolkit 4.0… and the cuda.h file looks like this:

"
#if __CUDA_API_VERSION >= 3020
/**

  • \brief Returns the total amount of memory on the device
  • Returns in \p *bytes the total amount of memory available on the device
  • \p dev in bytes.
  • \param bytes - Returned memory available on device in bytes
  • \param dev - Device handle
  • \return
  • ::CUDA_SUCCESS,
  • ::CUDA_ERROR_DEINITIALIZED,
  • ::CUDA_ERROR_NOT_INITIALIZED,
  • ::CUDA_ERROR_INVALID_CONTEXT,
  • ::CUDA_ERROR_INVALID_VALUE,
  • ::CUDA_ERROR_INVALID_DEVICE
  • \notefnerr
  • \sa ::cuDeviceComputeCapability,
  • ::cuDeviceGetAttribute,
  • ::cuDeviceGetCount,
  • ::cuDeviceGetName,
  • ::cuDeviceGet,
  • ::cuDeviceGetProperties,
    */
    CUresult CUDAAPI cuDeviceTotalMem(size_t bytes, CUdevice dev);
    #endif /
    __CUDA_API_VERSION >= 3020 */
    "

size_t is a 32 bit integer.

The api is repeated at the bottom of cuda.h and it’s also an unsigned int which pretty much looks 32 bit to me as well.

So why do you believe it’s actually 64 bit ? You have any proof of this ?

I’ll have to disagree with that… I am using CUDA Toolkit 4.0… and the cuda.h file looks like this:

"
#if __CUDA_API_VERSION >= 3020
/**

  • \brief Returns the total amount of memory on the device
  • Returns in \p *bytes the total amount of memory available on the device
  • \p dev in bytes.
  • \param bytes - Returned memory available on device in bytes
  • \param dev - Device handle
  • \return
  • ::CUDA_SUCCESS,
  • ::CUDA_ERROR_DEINITIALIZED,
  • ::CUDA_ERROR_NOT_INITIALIZED,
  • ::CUDA_ERROR_INVALID_CONTEXT,
  • ::CUDA_ERROR_INVALID_VALUE,
  • ::CUDA_ERROR_INVALID_DEVICE
  • \notefnerr
  • \sa ::cuDeviceComputeCapability,
  • ::cuDeviceGetAttribute,
  • ::cuDeviceGetCount,
  • ::cuDeviceGetName,
  • ::cuDeviceGet,
  • ::cuDeviceGetProperties,
    */
    CUresult CUDAAPI cuDeviceTotalMem(size_t bytes, CUdevice dev);
    #endif /
    __CUDA_API_VERSION >= 3020 */
    "

size_t is a 32 bit integer.

The api is repeated at the bottom of cuda.h and it’s also an unsigned int which pretty much looks 32 bit to me as well.

So why do you believe it’s actually 64 bit ? You have any proof of this ?