nvmlSetMemoryLimits_v1_t#

struct nvmlSetMemoryLimits_v1_t#

Describes the memory limits that can be set for the device.

This structure holds the necessary information that can be used to set the soft and hard memory limits of a device.

The softLimit is the amount of memory that is guaranteed before allocations may fail due to memory pressure.

The hardLimit is the maximum amount of memory that can be allocated.

This should be cross-referenced with nvmlDeviceGetMemoryInfo_v2 while in that cgroup to see how much memory is actually available to allocate for the device.

To clear the limits, set softLimit to 0, and hardLimit to NVML_DEVICE_MEMORY_LIMIT_MAX. Removing the cgroup will also clear any limits.

Public Members

const char *nameSpace#

[in] Full path to sysfs cgroup file name

unsigned long long softLimit#

[in] Soft memory limit in Bytes.

unsigned long long hardLimit#

[in] Hard memory limit in Bytes.