From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 408731FF13C for ; Thu, 02 Apr 2026 13:21:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8CD3C13EE1; Thu, 2 Apr 2026 13:22:18 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH common/manager/proxmox-perl-rs/qemu-server v2 0/5] use NVML for vGPU info querying Date: Thu, 2 Apr 2026 13:21:59 +0200 Message-ID: <20260402112212.2294356-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.455 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 2LQBZUFS4UGE5B46EK7T5Z7GGXVZGW7P X-Message-ID-Hash: 2LQBZUFS4UGE5B46EK7T5Z7GGXVZGW7P X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This series replaces Christoph's previous series[0] It's more or less a rewrite, thus no v2 or similar, but some patches directly take code from Christoph's attempt, so i marked those commits as co-developed-by. Changes: Instead of using our own wrapper+high level abstraction use the already existing 'nvml-wrapper' and 'nvml-wrapper-sys' which had a very similar approach, but are already packaged in debian. (though not fully up-to-date to what we need, so i updated/backported the patches) Also i expose two functions, 'creatable' and 'supported' for future proofing, since we want to have a more complete response in the api about which profiles are available. I moved the code that depends on the perlmod binding to qemu-server for now as it seemed fitting, we only need it there and in pve-manager If wanted I can split it out into it's own package (proxmox-pci? proxmox-hardware? proxmox-mdev?, not sure what's a good name for this), but that could also be done later when we need it. Also changed the format of the description from 'x,y,z' to 'x y z' since that's what was there previously and what the gui expects. Also the fields themselves can contain ',' so parsing would be unnecessarily hard when we use commas. The pve-common cleanup patch is optional, and as an alternative we could just mark these deprecated and remove them with e.g. 10.0 so we can save us a breaks cyclye for pve-common <-> qemu-server. NOTE: qemu-server and pve-manager need a versioned dependency: qemu-server on a bumped lib-pve-rs pve-manager on a bumped qemu-server (since i can't know the versions beforehad, i'll leave that to the committer) The performance indicated by Christoph seems fine for me for now, so any optimizations necessary, we can do later too (e.g. not unloading the module somehow, or caching the json values in perl, etc.) changes from v1: * rebase on master (dropped debcargo patches since they're already applied) * add dependency to d/control files 0: https://lore.proxmox.com/pve-devel/20260120131319.949986-1-c.heiss@proxmox.com/ proxmox-perl-rs: Dominik Csapak (1): pve: add binding for accessing vgpu info pve-rs/Cargo.toml | 1 + pve-rs/Makefile | 1 + pve-rs/debian/control | 1 + pve-rs/src/bindings/mod.rs | 3 ++ pve-rs/src/bindings/nvml.rs | 91 +++++++++++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 pve-rs/src/bindings/nvml.rs qemu-server: Dominik Csapak (2): pci: move mdev related code to own module pci: mdev: use PVE::RS::NVML for nvidia mdev information src/PVE/QemuServer.pm | 5 +- src/PVE/QemuServer/Makefile | 1 + src/PVE/QemuServer/PCI.pm | 58 +++-------- src/PVE/QemuServer/PCI/Makefile | 9 ++ src/PVE/QemuServer/PCI/Mdev.pm | 164 ++++++++++++++++++++++++++++++++ 5 files changed, 190 insertions(+), 47 deletions(-) create mode 100644 src/PVE/QemuServer/PCI/Makefile create mode 100644 src/PVE/QemuServer/PCI/Mdev.pm pve-manager: Dominik Csapak (1): api: hardware: pci: use NVML for querying mdev information PVE/API2/Hardware/PCI.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) pve-common: Dominik Csapak (1): sysfs tools: remove moved code src/PVE/SysFSTools.pm | 111 ------------------------------------------ 1 file changed, 111 deletions(-) Summary over all repositories: 12 files changed, 290 insertions(+), 161 deletions(-) -- Generated by git-murpp 0.8.1