Add configurable --sysfs-root for NUMA detection and PCI discovery#1836
Add configurable --sysfs-root for NUMA detection and PCI discovery#1836giuliocalzo wants to merge 1 commit into
Conversation
Enable mock-GPU test environments to supply synthetic PCI sysfs trees for device-plugin NUMA topology and GFD vGPU PCI scanning without changing production defaults. Signed-off-by: Giulio Calzolari <gcalzolari@nvidia.com>
b3bde09 to
d5b893b
Compare
|
@tariq1890 @cdesiniotis Could you please review? This implements #1833 (--sysfs-root for NUMA detection and GFD PCI scanning). |
|
Thanks @giuliocalzo ! Is this primarily motivated to serve test frameworks? I was wondering if there are scenarios where a live environment would have a custom sysfs root. |
|
hi @tariq1890 — the primary motivation is test frameworks, specifically mock-GPU environments in k8s-test-infra that use synthetic PCI sysfs trees from Today I don't expect live production clusters to set a custom sysfs root — the default stays Happy to trim scope or adjust naming if you'd prefer to keep this test-infra-only in documentation. |
|
Thank you for the context. In general, I'd like to avoid making significant changes to the code if it is to get the project to work with mocking and test frameworks. Have you looked into |
|
Hi, just chiming in that we also plan on using this for e2e testing for KAI-scheduler together with NVML-Mock for NUMA awareness, so this would be really helpful for us. It looks like the change is in line with the pattern used by --nvidia-driver-root, as @giuliocalzo wrote. Happy to talk through it more if that would help. |
Configurable nvidia driver root is needed to support the driver container use case, where as custom sysfs root is not motivated by a use-case that could exist in live environments. Modifying the k8s-device-plugin CLI interface to accommodate a test framework seems like an architectural smell to me. |
|
@tariq1890 looking at https://www.kernel.org/doc/html/v4.19/admin-guide/sysfs-rules.html i see: Could we strip down the changes in this PR to a minimal Here's an attempt with a few more suggestions: including:
|
Summary
--sysfs-root/$SYSFS_ROOT(default/sys) as a shared flag for the device plugin and GFD, matching the pattern used by--nvidia-driver-rootGetNumaNodefor GPU and MIG device NUMA topology, and into GFDpciutilfor vGPU PCI scanningsysfsRoot,sysfsHostPath) for injectingSYSFS_ROOTand optionally mounting a synthetic PCI sysfs treeCloses #1833
Motivation
Mock-GPU test environments (e.g. k8s-test-infra
render-pci-sysfs) need the plugin to read NUMA affinity from a synthetic PCI sysfs tree rather than the hardcoded/syspath. Without this,GetNumaNodesilently reports no NUMA and devices are advertised without topology.Test plan
go test ./internal/rm/ ./internal/vgpu/ ./api/config/v1/go build ./cmd/nvidia-device-plugin/ ./cmd/gpu-feature-discovery/SYSFS_ROOTandsysfs-rootvolume whensysfsRoot+sysfsHostPathare set