Ejemplo n.º 1
0
 private static bool NvSetPStateV2(int busId, ref NvGpuPerfPStates20InfoV2 info)
 {
     if (NvapiNativeMethods.NvSetPStateV2 == null)
     {
         return(false);
     }
     try {
         if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle))
         {
             return(false);
         }
         var r = NvapiNativeMethods.NvSetPStateV2(handle, ref info);
         if (r != NvStatus.NVAPI_OK)
         {
             NTMinerConsole.DevError(() => $"{nameof(NvapiNativeMethods.NvSetPStateV2)} {r.ToString()}");
         }
         if (r == NvStatus.NVAPI_OK)
         {
             return(true);
         }
     }
     catch {
     }
     return(false);
 }
Ejemplo n.º 2
0
 private bool NvSetPStateV2(int busId, ref NvGpuPerfPStates20InfoV2 info)
 {
     if (NvapiNativeMethods.NvSetPStateV2 == null)
     {
         return(false);
     }
     try {
         if (!HandlesByBusId.TryGetValue(busId, out NvPhysicalGpuHandle handle))
         {
             return(false);
         }
         info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuPerfPStates20InfoV2))));
         var r = NvapiNativeMethods.NvSetPStateV2(handle, ref info);
         if (r != NvStatus.NVAPI_OK)
         {
             Write.DevError($"{nameof(NvapiNativeMethods.NvSetPStateV2)} {r.ToString()}");
         }
         if (r == NvStatus.NVAPI_OK)
         {
             return(true);
         }
     }
     catch {
     }
     return(false);
 }
Ejemplo n.º 3
0
 private bool NvSetPStateV2(int busId, ref NvGpuPerfPStates20InfoV2 info)
 {
     if (NvapiNativeMethods.NvSetPStateV2 == null)
     {
         return(false);
     }
     try {
         info.version = (uint)(VERSION2 | (Marshal.SizeOf(typeof(NvGpuPerfPStates20InfoV2))));
         var r = NvapiNativeMethods.NvSetPStateV2(HandlesByBusId[busId], ref info);
         if (r != NvStatus.OK)
         {
             Write.DevError($"{nameof(NvapiNativeMethods.NvSetPStateV2)} {r}");
         }
         if (r == NvStatus.OK)
         {
             return(true);
         }
     }
     catch {
     }
     return(false);
 }