mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Nvidia-smi tweaks
This commit is contained in:
@@ -30,6 +30,14 @@ public static class NvidiaSmi
|
||||
return false; // Return false if the "Display Active" status is not found
|
||||
}
|
||||
|
||||
public static int GetDefaultMaxGPUPower()
|
||||
{
|
||||
if (AppConfig.ContainsModel("GU605")) return 125;
|
||||
if (AppConfig.ContainsModel("GA403")) return 90;
|
||||
if (AppConfig.ContainsModel("FA607")) return 140;
|
||||
else return 175;
|
||||
}
|
||||
|
||||
public static int GetMaxGPUPower()
|
||||
{
|
||||
string output = RunNvidiaSmiCommand("--query-gpu=power.max_limit --format csv,noheader,nounits");
|
||||
@@ -38,11 +46,10 @@ public static class NvidiaSmi
|
||||
if (float.TryParse(output, out float floatValue))
|
||||
{
|
||||
int intValue = (int)floatValue;
|
||||
if (intValue < 50 || intValue > 175) return -1;
|
||||
return intValue;
|
||||
if (intValue >= 50 && intValue <= 175) return intValue;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return GetDefaultMaxGPUPower();
|
||||
}
|
||||
|
||||
private static string RunNvidiaSmiCommand(string arguments = "-i 0 -q")
|
||||
|
||||
Reference in New Issue
Block a user