mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
GPU detection https://github.com/seerge/g-helper/issues/1112
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.113</AssemblyVersion>
|
<AssemblyVersion>0.114</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ namespace GHelper.Gpu
|
|||||||
ScreenControl screenControl = new ScreenControl();
|
ScreenControl screenControl = new ScreenControl();
|
||||||
|
|
||||||
public static int gpuMode;
|
public static int gpuMode;
|
||||||
|
public static bool? gpuExists = null;
|
||||||
|
|
||||||
|
|
||||||
public GPUModeControl(SettingsForm settingsForm)
|
public GPUModeControl(SettingsForm settingsForm)
|
||||||
{
|
{
|
||||||
@@ -38,8 +40,15 @@ namespace GHelper.Gpu
|
|||||||
|
|
||||||
// Ultimate mode not supported
|
// Ultimate mode not supported
|
||||||
if (mux != 1) settings.HideUltimateMode();
|
if (mux != 1) settings.HideUltimateMode();
|
||||||
|
|
||||||
// GPU mode not supported
|
// GPU mode not supported
|
||||||
if (eco < 0 && mux < 0) settings.HideGPUModes();
|
if (eco < 0 && mux < 0)
|
||||||
|
{
|
||||||
|
if (gpuExists is null)
|
||||||
|
gpuExists = HardwareControl.FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan)) is not null;
|
||||||
|
|
||||||
|
settings.HideGPUModes((bool)gpuExists);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AppConfig.Set("gpu_mode", gpuMode);
|
AppConfig.Set("gpu_mode", gpuMode);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public static class HardwareControl
|
|||||||
if (fan < 0)
|
if (fan < 0)
|
||||||
{
|
{
|
||||||
fan += 65536;
|
fan += 65536;
|
||||||
if (fan < 0 || fan > 100) return null; //nothing reasonable
|
if (fan <= 0 || fan > 100) return null; //nothing reasonable
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fan > fanMax && fan <= INADEQUATE_MAX) fanMax = fan;
|
if (fan > fanMax && fan <= INADEQUATE_MAX) fanMax = fan;
|
||||||
|
|||||||
@@ -996,7 +996,7 @@ namespace GHelper
|
|||||||
menuUltimate.Visible = false;
|
menuUltimate.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideGPUModes()
|
public void HideGPUModes(bool gpuExists)
|
||||||
{
|
{
|
||||||
isGpuSection = false;
|
isGpuSection = false;
|
||||||
|
|
||||||
@@ -1009,10 +1009,7 @@ namespace GHelper
|
|||||||
|
|
||||||
SetContextMenu();
|
SetContextMenu();
|
||||||
|
|
||||||
var gpuFan = Program.acpi.DeviceGet(AsusACPI.GPU_Fan);
|
panelGPU.Visible = gpuExists;
|
||||||
Logger.WriteLine("GPU check:" + gpuFan);
|
|
||||||
|
|
||||||
if (HardwareControl.FormatFan(gpuFan) is null) panelGPU.Visible = false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user