it's not yet included in an upstream release, but we need it.

Signed-off-by: Dominik Csapak <[email protected]>
---
 ...-method-for-getting-the-vGPU-type-id.patch | 32 +++++++++++++++++++
 src/nvml-wrapper/debian/patches/series        |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 
src/nvml-wrapper/debian/patches/add-method-for-getting-the-vGPU-type-id.patch

diff --git 
a/src/nvml-wrapper/debian/patches/add-method-for-getting-the-vGPU-type-id.patch 
b/src/nvml-wrapper/debian/patches/add-method-for-getting-the-vGPU-type-id.patch
new file mode 100644
index 0000000000..9c0d192c7f
--- /dev/null
+++ 
b/src/nvml-wrapper/debian/patches/add-method-for-getting-the-vGPU-type-id.patch
@@ -0,0 +1,32 @@
+From 09ce7912eb233dd9f577a858250e95e5f95eac16 Mon Sep 17 00:00:00 2001
+From: flumm <[email protected]>
+Date: Thu, 5 Mar 2026 00:31:43 +0100
+Subject: [PATCH] add method for getting the vGPU type id (#124)
+
+This is useful for example on linux, where this id is the same as the
+one that needs to be written into sysfs for creating a vGPU instance.
+
+Signed-off-by: Dominik Csapak <[email protected]>
+---
+ nvml-wrapper/src/vgpu.rs | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/nvml-wrapper/src/vgpu.rs b/nvml-wrapper/src/vgpu.rs
+index 548e7eb..25d1624 100644
+--- a/src/vgpu.rs
++++ b/src/vgpu.rs
+@@ -33,6 +33,11 @@ impl<'dev> VgpuType<'dev> {
+         self.device
+     }
+ 
++    /// Get the underlying vGPU type id.
++    pub fn id(&self) -> nvmlVgpuTypeId_t {
++        self.id
++    }
++
+     /// Retrieve the class of the vGPU type.
+     ///
+     /// # Errors
+-- 
+2.47.3
+
diff --git a/src/nvml-wrapper/debian/patches/series 
b/src/nvml-wrapper/debian/patches/series
index fa7eaac47a..bc012a32ec 100644
--- a/src/nvml-wrapper/debian/patches/series
+++ b/src/nvml-wrapper/debian/patches/series
@@ -1 +1,2 @@
 relax-deps.diff
+add-method-for-getting-the-vGPU-type-id.patch
-- 
2.47.3




Reply via email to