GPU detection will log errors to Sentry.io

This commit is contained in:
Kamil Trzciński 2022-12-20 14:39:21 +01:00
parent 4398177722
commit 9d4828fdf1
3 changed files with 32 additions and 19 deletions

View file

@ -8,6 +8,8 @@ namespace PowerControl
{
internal static class Program
{
const int MAX_GPU_RETRIES = 3;
/// <summary>
/// The main entry point for the application.
/// </summary>
@ -24,11 +26,13 @@ namespace PowerControl
"You are running EXPERIMENTAL build."))
return;
for (int i = 0; !VangoghGPU.IsSupported; i++)
for (int i = 0; !VangoghGPU.IsSupported && i < MAX_GPU_RETRIES; i++)
{
Instance.WithGlobalMutex(1000, () => VangoghGPU.Detect());
if (VangoghGPU.IsSupported)
Thread.Sleep(300);
var status = Instance.WithGlobalMutex(1000, () => VangoghGPU.Detect());
if (status != VangoghGPU.DetectionStatus.Retryable)
break;
Thread.Sleep(300);
}
}