File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -973,6 +973,33 @@ impl Nvml {
973
973
ExcludedDeviceInfo :: try_from ( info)
974
974
}
975
975
}
976
+
977
+ /**
978
+ Gets the loaded vGPU list of capabilities
979
+
980
+ # Errors
981
+
982
+ * `Uninitialized`, if the library has not been successfully initialized
983
+ * `Unknown`, on any unexpected error
984
+
985
+ # Device Support
986
+
987
+ Supports all devices.
988
+ */
989
+ #[ doc( alias = "nvmlGetVgpuDriverCapabilities" ) ]
990
+ pub fn vgpu_driver_capabilities (
991
+ & self ,
992
+ capability : nvmlVgpuDriverCapability_t ,
993
+ ) -> Result < u32 , NvmlError > {
994
+ let sym = nvml_sym ( self . lib . nvmlGetVgpuDriverCapabilities . as_ref ( ) ) ?;
995
+
996
+ unsafe {
997
+ let mut mask: u32 = mem:: zeroed ( ) ;
998
+
999
+ nvml_try ( sym ( capability, & mut mask) ) ?;
1000
+ Ok ( mask)
1001
+ }
1002
+ }
976
1003
}
977
1004
978
1005
/// This `Drop` implementation ignores errors! Use the `.shutdown()` method on
@@ -1239,4 +1266,10 @@ mod test {
1239
1266
test ( 3 , || nvml. excluded_device_info ( 0 ) )
1240
1267
}
1241
1268
}
1269
+
1270
+ #[ test]
1271
+ fn vgpu_driver_capabilities ( ) {
1272
+ let nvml = nvml ( ) ;
1273
+ test ( 3 , || nvml. vgpu_driver_capabilities ( 1 ) )
1274
+ }
1242
1275
}
You can’t perform that action at this time.
0 commit comments