コード例 #1
0
ファイル: GPUParam.cs プロジェクト: sparco1987/fermtools
        private void UpdateAMD()
        {
            //Clock GPU, MEM
            int GPUClock = 0; int MemClock = 0; int GPULoad = 0; int MemLoad = 0;

            if (ADL.ADL_Overdrive5_CurrentActivity_Get(adapterInfo.AdapterIndex, ref adlp) == ADL.ADL_OK)
            {
                if (adlp.EngineClock > 0)
                {
                    GPUClock = adlp.EngineClock / 100;
                }
                if (adlp.MemoryClock > 0)
                {
                    MemClock = adlp.MemoryClock / 100;
                }
                //Load GPU, MEM
                GPULoad = adlp.ActivityPercent;
                MemLoad = 0;
            }
            GPUParams[0].ParCollect.Add(GPUClock);
            GPUParams[1].ParCollect.Add(MemClock);
            GPUParams[2].ParCollect.Add(GPULoad);
            GPUParams[3].ParCollect.Add(MemLoad);
            //Temperature GPU
            int GPUTemp = 0;

            if (ADL.ADL_Overdrive5_Temperature_Get(adapterInfo.AdapterIndex, 0, ref adlt) == ADL.ADL_OK)
            {
                GPUTemp = adlt.Temperature / 1000;
            }
            GPUParams[4].ParCollect.Add(GPUTemp);
            //Fan speed %, RPM
            int FANprecentage = 0; int FANrpm = 0;

            if (ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterInfo.AdapterIndex, 0, ref afsi) == ADL.ADL_OK)
            {
                adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
                if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterInfo.AdapterIndex, 0, ref adlf) == ADL.ADL_OK)
                {
                    FANprecentage = adlf.FanSpeed;
                }
                adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_RPM;
                if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterInfo.AdapterIndex, 0, ref adlf) == ADL.ADL_OK)
                {
                    FANrpm = adlf.FanSpeed;
                }
            }
            GPUParams[5].ParCollect.Add(FANprecentage);
            GPUParams[6].ParCollect.Add(FANrpm);
        }
コード例 #2
0
 public ATIGroup(ref List <GPUParam> gpupar, int numpar)
 {
     try
     {
         int status = ADL.ADL_Main_Control_Create(1);
         report.AppendLine("AMD Display Library");
         report.AppendLine();
         report.Append("Status: ");
         report.AppendLine(status == ADL.ADL_OK ? "OK" : status.ToString(CultureInfo.InvariantCulture));
         report.AppendLine();
         if (status == ADL.ADL_OK)
         {
             int numberOfAdapters = 0;
             ADL.ADL_Adapter_NumberOfAdapters_Get(ref numberOfAdapters);
             report.Append("Number of adapters: ");
             report.AppendLine(numberOfAdapters.ToString(CultureInfo.InvariantCulture));
             report.AppendLine();
             if (numberOfAdapters > 0)
             {
                 ADLAdapterInfo[] adapterInfo = new ADLAdapterInfo[numberOfAdapters];
                 if (ADL.ADL_Adapter_AdapterInfo_Get(adapterInfo) == ADL.ADL_OK)
                 {
                     for (int i = 0; i < numberOfAdapters; i++)
                     {
                         int isActive;
                         ADL.ADL_Adapter_Active_Get(adapterInfo[i].AdapterIndex, out isActive);
                         int adapterID;
                         ADL.ADL_Adapter_ID_Get(adapterInfo[i].AdapterIndex, out adapterID);
                         report.Append("AdapterIndex: ");
                         report.AppendLine(i.ToString(CultureInfo.InvariantCulture));
                         report.Append("isActive: ");
                         report.AppendLine(isActive.ToString(CultureInfo.InvariantCulture));
                         report.Append("AdapterName: ");
                         report.AppendLine(adapterInfo[i].AdapterName);
                         report.Append("UDID: ");
                         report.AppendLine(adapterInfo[i].UDID);
                         report.Append("Present: ");
                         report.AppendLine(adapterInfo[i].Present.ToString(CultureInfo.InvariantCulture));
                         report.Append("VendorID: 0x");
                         report.AppendLine(adapterInfo[i].VendorID.ToString("X", CultureInfo.InvariantCulture));
                         report.Append("BusNumber: ");
                         report.AppendLine(adapterInfo[i].BusNumber.ToString(CultureInfo.InvariantCulture));
                         report.Append("DeviceNumber: ");
                         report.AppendLine(adapterInfo[i].DeviceNumber.ToString(CultureInfo.InvariantCulture));
                         report.Append("FunctionNumber: ");
                         report.AppendLine(adapterInfo[i].FunctionNumber.ToString(CultureInfo.InvariantCulture));
                         report.Append("AdapterID: 0x");
                         report.AppendLine(adapterID.ToString("X", CultureInfo.InvariantCulture));
                         if (!string.IsNullOrEmpty(adapterInfo[i].UDID) && adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID)
                         {
                             bool found = false;
                             foreach (GPUParam gpu in gpupar)
                             {
                                 if (gpu.adapterInfo.BusNumber == adapterInfo[i].BusNumber && gpu.adapterInfo.DeviceNumber == adapterInfo[i].DeviceNumber)
                                 {
                                     found = true;
                                     break;
                                 }
                             }
                             if (!found)
                             {
                                 gpupar.Add(new GPUParam(adapterInfo[i], numpar));
                             }
                         }
                         report.AppendLine();
                     }
                 }
             }
         }
     }
     catch (DllNotFoundException)
     {
     }
     catch (EntryPointNotFoundException e)
     {
         report.AppendLine();
         report.AppendLine(e.ToString());
         report.AppendLine();
     }
 }
コード例 #3
0
        private void UpdateCurr()
        {
            if (ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt) == ADL.ADL_OK)
            {
                gpucurr.GPUTemp = adlt.Temperature / 1000;
            }
            else
            {
                gpucurr.GPUTemp = 0;
            }

            if (ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref afsi) == ADL.ADL_OK)
            {
                adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
                if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf) == ADL.ADL_OK)
                {
                    gpucurr.FanLoad = adlf.FanSpeed;
                }
                else
                {
                    gpucurr.FanLoad = 0;
                }
                adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_RPM;
                if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf) == ADL.ADL_OK)
                {
                    gpucurr.FanRPM = adlf.FanSpeed;
                }
                else
                {
                    gpucurr.FanRPM = 0;
                }
            }

            if (ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp) == ADL.ADL_OK)
            {
                if (adlp.EngineClock > 0)
                {
                    gpucurr.CoreClock = adlp.EngineClock / 100;
                }
                else
                {
                    gpucurr.CoreClock = 0;
                }
                if (adlp.MemoryClock > 0)
                {
                    gpucurr.MemoryClock = adlp.MemoryClock / 100;
                }
                else
                {
                    gpucurr.MemoryClock = 0;
                }
                if (adlp.Vddc > 0)
                {
                }
                gpucurr.GPULoad     = adlp.ActivityPercent;
                gpucurr.MemCtrlLoad = 0;
            }
            else
            {
                gpucurr.GPULoad = 0;
            }
        }