volcano-sh / devices

Device plugins for Volcano, e.g. GPU
Apache License 2.0
97 stars 41 forks source link

support config gpu memory factor #28

Closed peiniliu closed 1 year ago

peiniliu commented 2 years ago

As described in #19 and #22, the device plugin needs to support config GPU memory factor to control the number of virtual devices that Listandwatched by kubelet. By default, we support each memory block as 1MB, this PR support config this factor, so that users can specify their own GPU memory granularity.

Tested Results:

2022/08/15 08:57:18 Loading configuration. 2022/08/15 08:57:18 Running with config: { "version": "v1beta1", "flags": { "GPUStrategy": "share", "GPUMemoryFactor": 10 } }

ENV of pod1.yml NVIDIA_VISIBLE_DEVICES=0 NVIDIA_DRIVER_CAPABILITIES=compute,utility VOLCANO_GPU_MEMORY_TOTAL=15109 VOLCANO_GPU_ALLOCATED=10240

Signed-off-by: peiniliu peini.liu@gmail.com