feat: add new CDI hook to set CUDA memory limits - #2075
Conversation
e74a378 to
33c5844
Compare
Coverage Report for CI Build 34788198846Coverage decreased (-0.2%) to 43.787%Details
Uncovered Changes
Coverage Regressions4 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
18696a4 to
fcca9a9
Compare
465ea21 to
d07ebd9
Compare
8c66f16 to
567826e
Compare
6e8b4d1 to
544986e
Compare
| if !hasRequest && !hasLimit { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
@cdesiniotis this logic has been updated since the last approve. In the latest iteration, setting both the request and limits are no longer mandatory; either one env var being set is enough for the the CDI hook to call the NVML Memory Limits API.
The new behaviour is as follows
i) If both env vars are set, it continues to work as before
ii) If only the request env var is set, the limit is set to the max-possible uint64 values
iii) If only the limit env var is set, then the request is set to the same value as the limit.
Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com> get cgroup path from procfs instead Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
544986e to
2d76167
Compare
|
/cherry-pick release-1.20 |
|
🤖 Backport PR created for |
|
/cherry-pick release-1.20 |
|
🤖 Backport PR created for |
This commit introduces a new subcommand of the nvidia CDI hook called apply-cuda-memory-limits. The purpose of this CDI hook is to apply the desired memory limits to a GPU device.
It reads the following envars from a container spec to fetch the input parameters for the CDI hook
Under the covers, the CDI hooks invokes the new NVML
SetMemoryLimits_v1method (introduced in CUDA 13.4) to apply the desired CUDA memory limit values to the cgroup of the GPU container in question