Example #1
0
        public ATIGPU(string name, int adapterIndex, int busNumber,
                      int deviceNumber, ISettings settings)
            : base(name, new Identifier("atigpu",
                                        adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
        {
            this.adapterIndex = adapterIndex;
            this.busNumber    = busNumber;
            this.deviceNumber = deviceNumber;

            this.temperature   = new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
            this.fan           = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);
            this.coreClock     = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
            this.memoryClock   = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
            this.coreVoltage   = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
            this.coreLoad      = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
            this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);

            ADLFanSpeedInfo afsi = new ADLFanSpeedInfo();

            if (ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref afsi)
                != ADL.ADL_OK)
            {
                afsi.MaxPercent = 100;
                afsi.MinPercent = 0;
            }

            this.fanControl = new Control(controlSensor, settings, afsi.MinPercent,
                                          afsi.MaxPercent);
            this.fanControl.ControlModeChanged          += ControlModeChanged;
            this.fanControl.SoftwareControlValueChanged +=
                SoftwareControlValueChanged;
            ControlModeChanged(fanControl);
            this.controlSensor.Control = fanControl;
            Update();
        }
    public ATIGPU(string name, int adapterIndex, int busNumber, 
      int deviceNumber, ISettings settings) 
      : base(name, new Identifier("atigpu", 
        adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
    {
      this.adapterIndex = adapterIndex;
      this.busNumber = busNumber;
      this.deviceNumber = deviceNumber;

      this.temperature = new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
      this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);
      this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
      this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
      this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
      this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
      this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);

      ADLFanSpeedInfo afsi = new ADLFanSpeedInfo();
      if (ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref afsi)
        != ADL.ADL_OK) 
      {
        afsi.MaxPercent = 100;
        afsi.MinPercent = 0;
      }

      this.fanControl = new Control(controlSensor, settings, afsi.MinPercent, 
        afsi.MaxPercent);
      this.fanControl.ControlModeChanged += ControlModeChanged;
      this.fanControl.SoftwareControlValueChanged += 
        SoftwareControlValueChanged;
      ControlModeChanged(fanControl);
      this.controlSensor.Control = fanControl;
      Update();                   
    }
Example #3
0
        public ATIGPU(string name, int adapterIndex, int busNumber,
                      int deviceNumber)
        {
            this.name         = name;
            this.icon         = Utilities.EmbeddedResources.GetImage("ati.png");
            this.adapterIndex = adapterIndex;
            this.busNumber    = busNumber;
            this.deviceNumber = deviceNumber;

            ADLFanSpeedInfo speedInfo = new ADLFanSpeedInfo();

            ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref speedInfo);

            this.temperature =
                new Sensor("GPU Core", 0, SensorType.Temperature, this);
            this.fan         = new Sensor("GPU", 0, speedInfo.MaxRPM, SensorType.Fan, this);
            this.coreClock   = new Sensor("GPU Core", 0, SensorType.Clock, this);
            this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
            this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);
            this.coreLoad    = new Sensor("GPU Core", 0, SensorType.Load, this);
            Update();
        }
Example #4
0
        public ATIGPU(string name, int adapterIndex, int busNumber,
                      int deviceNumber, IntPtr context, ISettings settings)
            : base(name, new Identifier("atigpu",
                                        adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
        {
            this.adapterIndex = adapterIndex;
            this.busNumber    = busNumber;
            this.deviceNumber = deviceNumber;

            this.context = context;

            if (ADL.ADL_Overdrive_Caps(adapterIndex, out _, out _,
                                       out overdriveVersion) != ADLStatus.OK)
            {
                overdriveVersion = -1;
            }

            this.temperatureCore =
                new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
            this.temperatureMemory =
                new Sensor("GPU Memory", 1, SensorType.Temperature, this, settings);
            this.temperatureVrmCore =
                new Sensor("GPU VRM Core", 2, SensorType.Temperature, this, settings);
            this.temperatureVrmMemory =
                new Sensor("GPU VRM Memory", 3, SensorType.Temperature, this, settings);
            this.temperatureVrmMemory0 =
                new Sensor("GPU VRM Memory #1", 4, SensorType.Temperature, this, settings);
            this.temperatureVrmMemory1 =
                new Sensor("GPU VRM Memory #2", 5, SensorType.Temperature, this, settings);
            this.temperatureVrmSoc =
                new Sensor("GPU VRM SOC", 6, SensorType.Temperature, this, settings);
            this.temperatureLiquid =
                new Sensor("GPU Liquid", 7, SensorType.Temperature, this, settings);
            this.temperaturePlx =
                new Sensor("GPU PLX", 8, SensorType.Temperature, this, settings);
            this.temperatureHotSpot =
                new Sensor("GPU Hot Spot", 9, SensorType.Temperature, this, settings);

            this.powerTotal  = new Sensor("GPU Total", 0, SensorType.Power, this, settings);
            this.powerCore   = new Sensor("GPU Core", 1, SensorType.Power, this, settings);
            this.powerPpt    = new Sensor("GPU PPT", 2, SensorType.Power, this, settings);
            this.powerSocket = new Sensor("GPU Socket", 3, SensorType.Power, this, settings);
            this.powerSoc    = new Sensor("GPU SOC", 4, SensorType.Power, this, settings);

            this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);

            this.coreClock   = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
            this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
            this.socClock    = new Sensor("GPU SOC", 2, SensorType.Clock, this, settings);

            this.coreVoltage   = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
            this.memoryVoltage = new Sensor("GPU Memory", 1, SensorType.Voltage, this, settings);
            this.socVoltage    = new Sensor("GPU SOC", 2, SensorType.Voltage, this, settings);

            this.coreLoad   = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
            this.memoryLoad = new Sensor("GPU Memory", 1, SensorType.Load, this, settings);

            this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);

            ADLFanSpeedInfo afsi = new ADLFanSpeedInfo();

            if (ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref afsi)
                != ADLStatus.OK)
            {
                afsi.MaxPercent = 100;
                afsi.MinPercent = 0;
            }

            this.fanControl = new Control(controlSensor, settings, afsi.MinPercent,
                                          afsi.MaxPercent);
            this.fanControl.ControlModeChanged          += ControlModeChanged;
            this.fanControl.SoftwareControlValueChanged +=
                SoftwareControlValueChanged;
            ControlModeChanged(fanControl);
            this.controlSensor.Control = fanControl;
            Update();
        }
Example #5
0
        public ATIGPU(string name, int adapterIndex, int busNumber,
                      int deviceNumber, IntPtr context, ISettings settings)
            : base(name, new Identifier("atigpu",
                                        adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
        {
            this.adapterIndex = adapterIndex;
            this.busNumber    = busNumber;
            this.deviceNumber = deviceNumber;

            this.context = context;

            if (ADL.ADL_Overdrive_Caps(adapterIndex, out _, out _,
                                       out overdriveVersion) != ADL.ADL_OK)
            {
                overdriveVersion = -1;
            }

            this.temperatureCore =
                new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
            this.temperatureMemory =
                new Sensor("GPU Memory", 1, SensorType.Temperature, this, settings);
            this.temperatureVrmCore =
                new Sensor("GPU VRM Core", 2, SensorType.Temperature, this, settings);
            this.temperatureVrmMemory =
                new Sensor("GPU VRM Memory", 3, SensorType.Temperature, this, settings);
            //this.temperatureVrmMemory0 =
            //  new Sensor("GPU VRM Memory #1", 4, SensorType.Temperature, this, settings);
            //this.temperatureVrmMemory1 =
            //  new Sensor("GPU VRM Memory #2", 5, SensorType.Temperature, this, settings);
            this.temperatureVrmSoc =
                new Sensor("GPU VRM SOC", 6, SensorType.Temperature, this, settings);
            this.temperatureLiquid =
                new Sensor("GPU Liquid", 7, SensorType.Temperature, this, settings);
            this.temperaturePlx =
                new Sensor("GPU PLX", 8, SensorType.Temperature, this, settings);
            this.temperatureHotSpot =
                new Sensor("GPU Hot Spot", 9, SensorType.Temperature, this, settings);

            this.powerTotal  = new Sensor("GPU Total", 0, SensorType.Power, this, settings);
            this.powerCore   = new Sensor("GPU Core", 1, SensorType.Power, this, settings);
            this.powerPpt    = new Sensor("GPU PPT", 2, SensorType.Power, this, settings);
            this.powerSocket = new Sensor("GPU Socket", 3, SensorType.Power, this, settings);
            this.powerSoc    = new Sensor("GPU SOC", 4, SensorType.Power, this, settings);

            this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);

            this.coreClock   = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
            this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
            this.socClock    = new Sensor("GPU SOC", 2, SensorType.Clock, this, settings);

            this.coreVoltage   = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
            this.memoryVoltage = new Sensor("GPU Memory", 1, SensorType.Voltage, this, settings);
            this.socVoltage    = new Sensor("GPU SOC", 2, SensorType.Voltage, this, settings);

            this.coreLoad             = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
            this.memoryControllerLoad = new Sensor("GPU Memory Controller", 1, SensorType.Load, this, settings);

            try
            {
                if (PerformanceCounterCategory.Exists("GPU Adapter Memory"))
                {
                    var category  = new PerformanceCounterCategory("GPU Adapter Memory");
                    var instances = category.GetInstanceNames();

                    var(Usage, Index) = instances
                                        .Select(instance => new PerformanceCounter("GPU Adapter Memory", "Dedicated Usage", instance))
                                        .Select((u, i) => (Usage: u.RawValue, Index: i)).Max();

                    dedicatedVramUsagePerformCounter = new PerformanceCounter("GPU Adapter Memory", "Dedicated Usage", instances[Index]);
                    sharedVramUsagePerformCounter    = new PerformanceCounter("GPU Adapter Memory", "Shared Usage", instances[Index]);

                    this.memoryUsageDedicated = new Sensor("GPU Memory Dedicated", 0, SensorType.SmallData, this, settings);
                    this.memoryUsageShared    = new Sensor("GPU Memory Shared", 1, SensorType.SmallData, this, settings);
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex, "Error while creating GPU memory performance counter.");
            }

            this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);

            ADLFanSpeedInfo afsi = new ADLFanSpeedInfo();

            if (ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref afsi)
                != ADL.ADL_OK)
            {
                afsi.MaxPercent = 100;
                afsi.MinPercent = 0;
            }

            this.fanControl = new Control(controlSensor, settings, afsi.MinPercent,
                                          afsi.MaxPercent);
            this.fanControl.ControlModeChanged          += ControlModeChanged;
            this.fanControl.SoftwareControlValueChanged +=
                SoftwareControlValueChanged;
            ControlModeChanged(fanControl);
            this.controlSensor.Control = fanControl;
            Update();
        }
Example #6
0
 public static extern int ADL_Overdrive5_FanSpeedInfo_Get(int adapterIndex, int thermalControllerIndex, ref ADLFanSpeedInfo fanSpeedInfo);