# NVML release 470: nvmlMemory\_t::used doesn't contain 'reserved' memory

**URL:** <https://forums.developer.nvidia.com/t/nvml-release-470-nvmlmemory-t-used-doesnt-contain-reserved-memory/253200>\
**Category:** System Management and Monitoring (NVML)\
**Created:** [May 13, 2023, 2:32pm UTC](https://forums.developer.nvidia.com/t/nvml-release-470-nvmlmemory-t-used-doesnt-contain-reserved-memory/253200 "2023-05-13T14:32:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![liwei.peng](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@liwei.peng](https://forums.developer.nvidia.com/u/liwei.peng)\
**Post date:** [May 13, 2023, 2:32pm UTC](https://forums.developer.nvidia.com/t/nvml-release-470-nvmlmemory-t-used-doesnt-contain-reserved-memory/253200/1 "2023-05-13T14:32:48Z")

</div>

According to NVML release 470 API: [NVML API Reference Guide :: GPU Deployment and Management Documentation (nvidia.com)](https://docs.nvidia.com/deploy/archive/R470/nvml-api/structnvmlMemory __t.html#structnvmlMemory__ t), ‘used’ should never be 0 because driver/GPU always sets aside a small amount of memory for bookkeeping.

However, on the following system, the used memory is always 0. Can someone share why this occurs? What’s wrong? Thanks.

GPU: Tesla K80  
Driver Version: 470.82.01 CUDA Version: 11.4  
GPU load: no process is running

```auto
$ nvidia-smi --query-gpu=memory.total,memory.free,memory.used --format=csv,noheader
11441 MiB, 11441 MiB, 0 MiB

NVML code (error checking is removed)
void get_used_memory(void *libhandle, unsigned int gpuid, nvmlDevice_t dev_handle)
{
    nvmlMemory_t memoryInfo;
    *(void**) (&pfn_nvmlDeviceGetMemoryInfo) = dlsym(libhandle, "nvmlDeviceGetMemoryInfo");
    nvmlReturn_t nvmlReturn = pfn_nvmlDeviceGetMemoryInfo(dev_handle, &memoryInfo);
    float mib = 1024 * 1024.0;
    printf("GPU-%d memory(MiB): total=%d free=%d used=%d\n",
        gpuid,
        int(memoryInfo.total / mib),
        int(memoryInfo.free / mib),
        int(memoryInfo.used / mib));
}

results:
GPU-0 memory(MiB): total=11441 free=11441 used=0

```
