Пример #1
0
 private static bool NvGetPStateV2(int busId, out NvGpuPerfPStates20InfoV2 info)
 {
     info = NvGpuPerfPStates20InfoV2.Create();
     if (NvapiNativeMethods.NvGetPStateV2 == null)
     {
         return(false);
     }
     try {
         if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle))
         {
             return(false);
         }
         var r = NvapiNativeMethods.NvGetPStateV2(handle, ref info);
         if (r != NvStatus.NVAPI_OK)
         {
             NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvGetPStateV2)} {r.ToString()}");
             return(false);
         }
         return(true);
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(false);
     }
 }
Пример #2
0
 private bool NvGetPStateV2(int busId, out NvGpuPerfPStates20InfoV2 info)
 {
     info = new NvGpuPerfPStates20InfoV2();
     if (NvapiNativeMethods.NvGetPStateV2 == null)
     {
         return(false);
     }
     try {
         if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle))
         {
             return(false);
         }
         info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuPerfPStates20InfoV2))));
         var r = NvapiNativeMethods.NvGetPStateV2(handle, ref info);
         if (r != NvStatus.NVAPI_OK)
         {
             NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvGetPStateV2)} {r.ToString()}");
             return(false);
         }
         return(true);
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(false);
     }
 }
Пример #3
0
 private bool NvGetPStateV2(int busId, out NvGpuPerfPStates20InfoV2 info)
 {
     info = new NvGpuPerfPStates20InfoV2();
     if (NvapiNativeMethods.NvGetPStateV2 == null)
     {
         return(false);
     }
     try {
         info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuPerfPStates20InfoV2))));
         var r = NvapiNativeMethods.NvGetPStateV2(HandlesByBusId[busId], ref info);
         if (r != NvStatus.OK)
         {
             Write.DevError($"{nameof(NvapiNativeMethods.NvGetPStateV2)} {r}");
             return(false);
         }
         return(true);
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(false);
     }
 }