File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -1900,6 +1900,35 @@ impl<'nvml> Device<'nvml> {
1900
1900
}
1901
1901
}
1902
1902
1903
+ /**
1904
+ Sets fan control policy.
1905
+
1906
+ You can determine valid fan indices using [`Self::num_fans()`].
1907
+
1908
+ # Errors
1909
+
1910
+ * `Uninitialized`, if the library has not been successfully initialized
1911
+ * `InvalidArg`, if this `Device` is invalid or `fan_idx` is invalid
1912
+ * `NotSupported`, if this `Device` does not have a fan
1913
+ * `GpuLost`, if this `Device` has fallen off the bus or is otherwise inaccessible
1914
+ * `UnexpectedVariant`, for which you can read the docs for
1915
+ * `Unknown`, on any unexpected error
1916
+
1917
+ # Device Support
1918
+
1919
+ Supports Maxwell or newer fully supported discrete devices with fans.
1920
+ */
1921
+ #[ doc( alias = "nvmlDeviceSetFanControlPolicy" ) ]
1922
+ pub fn set_fan_control_policy (
1923
+ & mut self ,
1924
+ fan_idx : u32 ,
1925
+ policy : FanControlPolicy ,
1926
+ ) -> Result < ( ) , NvmlError > {
1927
+ let sym = nvml_sym ( self . nvml . lib . nvmlDeviceSetFanControlPolicy . as_ref ( ) ) ?;
1928
+
1929
+ unsafe { nvml_try ( sym ( self . device , fan_idx, policy. as_c ( ) ) ) }
1930
+ }
1931
+
1903
1932
/**
1904
1933
Sets the speed of a specified fan.
1905
1934
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ impl TryFrom<nvmlFanControlPolicy_t> for FanControlPolicy {
376
376
fn try_from ( value : nvmlFanControlPolicy_t ) -> Result < Self , Self :: Error > {
377
377
match value {
378
378
NVML_FAN_POLICY_TEMPERATURE_CONTINOUS_SW => Ok ( Self :: TemperatureContinousSw ) ,
379
- NVML_FAN_POLICY_MANUAL => Ok ( Self :: TemperatureContinousSw ) ,
379
+ NVML_FAN_POLICY_MANUAL => Ok ( Self :: Manual ) ,
380
380
_ => Err ( NvmlError :: UnexpectedVariant ( value) ) ,
381
381
}
382
382
}
Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ nvmlDevicePowerSmoothingSetState
90
90
nvmlDevicePowerSmoothingUpdatePresetProfileParam
91
91
nvmlDeviceSetConfComputeUnprotectedMemSize
92
92
nvmlDeviceSetDramEncryptionMode
93
- nvmlDeviceSetFanControlPolicy
94
93
nvmlDeviceSetMigMode
95
94
nvmlDeviceSetNvlinkBwMode
96
95
nvmlDeviceSetNvLinkDeviceLowPowerThreshold
You can’t perform that action at this time.
0 commit comments