ntminer 5 years ago
parent
commit
d54d82ff61

+ 5 - 3
src/NTMinerDataSchemas/Core/Gpus/GpuName.cs

@@ -1,17 +1,19 @@
 namespace NTMiner.Core.Gpus {
     public class GpuName : IGpuName {
         public static bool IsValidTotalMemory(ulong value) {
-            return value >= 2 * NTKeyword.ULongG;
+            return value >= 4 * NTKeyword.ULongG;
         }
 
         public GpuName() { }
 
+        public GpuType GpuType { get; set; }
+
         public string Name { get; set; }
 
         public ulong TotalMemory { get; set; }
 
         public bool IsValid() {
-            return !string.IsNullOrEmpty(Name) && IsValidTotalMemory(TotalMemory);
+            return GpuType != GpuType.Empty && !string.IsNullOrEmpty(Name) && IsValidTotalMemory(TotalMemory);
         }
 
         public override bool Equals(object obj) {
@@ -33,7 +35,7 @@
             ulong totalMemoryGb = (this.TotalMemory + NTKeyword.ULongG - 1) / NTKeyword.ULongG;
             // 通常显卡的名称上会带显存大小,比如1060分3G版和6G版所以NVIDIA命名显卡的时候
             // 已经带上了显存信息,但不能假定带了显存信息所以这里拼接上显存信息。
-            return $"{this.Name}///{totalMemoryGb.ToString()}";
+            return $"{this.GpuType.ToString()}///{this.Name}///{totalMemoryGb.ToString()}";
         }
     }
 }

+ 1 - 0
src/NTMinerDataSchemas/Core/Gpus/IGpuName.cs

@@ -1,5 +1,6 @@
 namespace NTMiner.Core.Gpus {
     public interface IGpuName {
+        GpuType GpuType { get; }
         string Name { get; }
         /// <summary>
         /// 单位Byte

+ 0 - 1
src/NTMinerDataSchemas/Core/Gpus/IGpuStaticData.cs

@@ -1,6 +1,5 @@
 namespace NTMiner.Core.Gpus {
     public interface IGpuStaticData : IGpuName {
-        GpuType GpuType { get; }
         int Index { get; }
         /// <summary>
         /// 必须是数字格式