123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using GpuFanControl.MsiAfterburnerWrap.ShareMemoryStructs;
- namespace GpuFanControl.MsiAfterburnerWrap
- {
- internal class TryingSandBox
- {
- public static void Go()
- {
- var ctl = new MsiAfterBurnControlWrap();
- ctl.Connect();
- ctl.Refresh();
- var numberOfGpu = ctl.GetNumberOfGpu();
- for (int i = 0; i < numberOfGpu; i++)
- {
- Console.WriteLine($"Get entry of GPU #{i}");
- MACM_SHARED_MEMORY_GPU_ENTRY? g;
- {
- g = ctl.GetGpuEntry(i, out string err);
- if (g.HasValue == false)
- {
- Console.WriteLine($"Err:{err}");
- continue;
- }
- }
- var entry = g.Value;
- if (entry.Flags.HasFlag(MACM_SHARED_MEMORY_GPU_ENTRY_FLAG.FAN_SPEED))
- {
- Console.WriteLine($"Updating fan speed of GPU #{i}");
- //entry.fanFlagsCur = MACM_SHARED_MEMORY_GPU_ENTRY_FAN_FLAG.AUTO;
- entry.FanFlagsCur = MACM_SHARED_MEMORY_GPU_ENTRY_FAN_FLAG.None;
- entry.FanSpeedCur = entry.FanSpeedMax;
- var err=ctl.SetGpuEntry(entry, i);
- if(err!=null) Console.WriteLine($"Err: {err}");
- }
- else
- {
- Console.WriteLine($"Err: No support fan speed");
- }
- }
- Console.WriteLine("Commiting...");
- ctl.Commit();
- Console.WriteLine("Success");
- ctl.Disconnect();
- }
- }
- }
|