Esempio n. 1
0
        //TODO fix constructor to not include 3rd party handles + refactor inside interface device info (lookup fans speed/temps/...)
        public CudaComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int gpuCount,
                                 NvPhysicalGpuHandle nvHandle, nvmlDevice nvmlHandle)
            : base((int)cudaDevice.DeviceID,
                   cudaDevice.GetName(),
                   true,
                   group,
                   DeviceType.NVIDIA,
                   string.Format(Translations.Tr("GPU#{0}"), gpuCount),
                   cudaDevice.DeviceGlobalMemory)
        {
            BusID             = cudaDevice.pciBusID;
            SMMajor           = cudaDevice.SM_major;
            SMMinor           = cudaDevice.SM_minor;
            Uuid              = cudaDevice.UUID;
            AlgorithmSettings = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            Index             = ID + AvailableDevices.AvailCpus; // increment by CPU count

            _nvHandle   = nvHandle;
            _nvmlDevice = nvmlHandle;

            ShouldRunEthlargement = cudaDevice.DeviceName.Contains("1080") || cudaDevice.DeviceName.Contains("Titan Xp");
            // plugin device
            var bd = new BaseDevice(DeviceType.NVIDIA, cudaDevice.UUID, cudaDevice.GetName(), (int)cudaDevice.DeviceID);

            PluginDevice = new CUDADevice(bd, cudaDevice.pciBusID, cudaDevice.DeviceGlobalMemory, cudaDevice.SM_major, cudaDevice.SM_minor);
        }
Esempio n. 2
0
        public CpuComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int cpuCount)
            : base(id,
                   name,
                   true,
                   DeviceGroupType.CPU,
                   DeviceType.CPU,
                   string.Format(Translations.Tr("CPU#{0}"), cpuCount),
                   0)
        {
            Threads      = threads;
            AffinityMask = affinityMask;
            var uuid = GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);

            Uuid = uuid;
            AlgorithmSettings = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            Index             = ID; // Don't increment for CPU

            _cpuCounter = new PerformanceCounter
            {
                CategoryName = "Processor",
                CounterName  = "% Processor Time",
                InstanceName = "_Total"
            };

            // plugin device
            var bd = new BaseDevice(DeviceType.CPU, uuid, name, ID);       // TODO UUID

            PluginDevice = new CPUDevice(bd, threads, true, affinityMask); // TODO hyperthreading
        }
Esempio n. 3
0
        public void XmrStakAlgorithmsForDevice_Tests()
        {
            var cpuDevice  = new CpuComputeDevice(0, "grp", "intel i7-8700k", 16, 0, 0);
            var algorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cpuDevice);

            Assert.AreEqual(3, algorithms.Count);

            foreach (var algorithm in algorithms) //check miner base type
            {
                Assert.AreEqual(MinerBaseType.XmrStak, algorithm.MinerBaseType);
            }

            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.CryptoNightHeavy,
                AlgorithmType.CryptoNightV8,
                AlgorithmType.CryptoNightR,
            };

            foreach (var secondaryAlgorithm in secondaryList) //check to see if all algorithms from secondary list are in algorithms
            {
                var algo = new Algorithm(MinerBaseType.XmrStak, secondaryAlgorithm);
                Assert.IsTrue(algorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
        }
        //TODO fix constructor to not include 3rd party handles + refactor inside interface device info (lookup fans speed/temps/...)
        public CudaComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int gpuCount,
                                 NvPhysicalGpuHandle nvHandle, nvmlDevice nvmlHandle)
            : base((int)cudaDevice.DeviceID,
                   cudaDevice.GetName(),
                   true,
                   group,
                   DeviceType.NVIDIA,
                   string.Format(Translations.Tr("GPU#{0}"), gpuCount),
                   cudaDevice.DeviceGlobalMemory)
        {
            BusID   = cudaDevice.pciBusID;
            SMMajor = cudaDevice.SM_major;
            SMMinor = cudaDevice.SM_minor;
            // if no nvml loaded fallback ID
            if (string.IsNullOrEmpty(cudaDevice.UUID))
            {
                Uuid = GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType);
            }
            else
            {
                Uuid = cudaDevice.UUID;
            }
            AlgorithmSettings = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            Index             = ID + AvailableDevices.AvailCpus; // increment by CPU count

            _nvHandle   = nvHandle;
            _nvmlDevice = nvmlHandle;

            ShouldRunEthlargement = cudaDevice.DeviceName.Contains("1080") || cudaDevice.DeviceName.Contains("Titan Xp");
        }
        public AmdComputeDevice(AmdGpuDevice amdDevice, int gpuCount, bool isDetectionFallback, int adl2Index)
            : base(amdDevice.DeviceID,
                   amdDevice.DeviceName,
                   true,
                   DeviceGroupType.AMD_OpenCL,
                   DeviceType.AMD,
                   string.Format(Translations.Tr("GPU#{0}"), gpuCount),
                   amdDevice.DeviceGlobalMemory)
        {
            Uuid = isDetectionFallback
                ? GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType)
                : amdDevice.Uuid;
            BusID              = amdDevice.BusID;
            Codename           = amdDevice.Codename;
            InfSection         = amdDevice.InfSection;
            AlgorithmSettings  = DefaultAlgorithms.GetAlgorithmsForDevice(this);
            DriverDisableAlgos = amdDevice.DriverDisableAlgos;
            Index              = ID + AvailableDevices.AvailCpus + AvailableDevices.AvailNVGpus;
            _adapterIndex      = amdDevice.Adl1Index;

            ADL.ADL2_Main_Control_Create?.Invoke(ADL.ADL_Main_Memory_Alloc, 0, ref _adlContext);
            _adapterIndex2 = adl2Index;

            // plugin device
            var bd = new BaseDevice(DeviceType.AMD, Uuid, Name, ID);

            PluginDevice = new AMDDevice(bd, amdDevice.BusID, amdDevice.DeviceGlobalMemory, Codename, InfSection);
        }
Esempio n. 6
0
        public void NBMinerAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> nbminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.NBMiner)
                {
                    nbminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.GrinCuckaroo29,
                AlgorithmType.GrinCuckatoo31,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.NBMiner, primaryAlgorithm);
                Assert.IsTrue(nbminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(2, nbminerAlgorithms.Count);
            foreach (var algo in nbminerAlgorithms)
            {
                Assert.IsTrue(algo.Enabled);
            }

            nbminerAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.NBMiner)
                {
                    nbminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, nbminerAlgorithms.Count);

            nbminerAlgorithms.Clear(); //low ram
            cudaDev       = cudaComputeDevLowRam();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.NBMiner)
                {
                    nbminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, nbminerAlgorithms.Count);
        }
Esempio n. 7
0
        public void ClaymoreDualAlgorithmsForDevice_Tests()
        {
            var device        = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(device);
            List <Algorithm> claymoreAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.Claymore)
                {
                    claymoreAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.NONE,
                AlgorithmType.Decred,
                AlgorithmType.Blake2s,
                AlgorithmType.Keccak,
            };

            foreach (var secondaryAlgorithm in secondaryList) //check to see if all algorithms from secondary list are in algorithms (dual with dager)
            {
                var algo = new Algorithm(MinerBaseType.Claymore, secondaryAlgorithm);
                Assert.IsTrue(claymoreAlgorithms.Any(a => algo.NiceHashID == a.SecondaryNiceHashID));
            }

            foreach (var algorithm in claymoreAlgorithms)
            {
                if (algorithm.SecondaryNiceHashID == AlgorithmType.NONE) //check that all duals are disabled by default
                {
                    Assert.IsTrue(algorithm.Enabled);
                }
                else
                {
                    Assert.IsFalse(algorithm.Enabled);
                }
            }

            claymoreAlgorithms.Clear();
            device        = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(device);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.Claymore)
                {
                    claymoreAlgorithms.Add(algorithm);
                }
            }

            Assert.AreEqual(0, claymoreAlgorithms.Count);
        }
Esempio n. 8
0
        public void ethminerAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> ethminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.ethminer)
                {
                    ethminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.DaggerHashimoto,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.ethminer, primaryAlgorithm);
                Assert.IsTrue(ethminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(1, ethminerAlgorithms.Count);
            Assert.IsFalse(ethminerAlgorithms[0].Enabled);

            ethminerAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.ethminer)
                {
                    ethminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, ethminerAlgorithms.Count);

            ethminerAlgorithms.Clear(); //750 ti
            cudaDev       = cudaComputeDev750Ti();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.ethminer)
                {
                    ethminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, ethminerAlgorithms.Count);
        }
Esempio n. 9
0
        public void TTMinerAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> ttminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.TTMiner)
                {
                    ttminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.MTP,
                AlgorithmType.Lyra2REv3,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.TTMiner, primaryAlgorithm);
                Assert.IsTrue(ttminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(2, ttminerAlgorithms.Count);
            foreach (var algo in ttminerAlgorithms)
            {
                Assert.IsFalse(algo.Enabled);
            }

            ttminerAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.TTMiner)
                {
                    ttminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, ttminerAlgorithms.Count);
        }
Esempio n. 10
0
        public void ProspectorAlgorithmsForDevice_tests()
        {
            var openCLDevice  = amdComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            List <Algorithm> prospectorAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.Prospector)
                {
                    prospectorAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.Skunk,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.Prospector, primaryAlgorithm);
                Assert.IsTrue(prospectorAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(1, prospectorAlgorithms.Count);
            Assert.IsFalse(prospectorAlgorithms[0].Enabled);

            prospectorAlgorithms.Clear(); //cuda device
            var cudaDevice = cudaComputeDev();

            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.Prospector)
                {
                    prospectorAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, prospectorAlgorithms.Count);
        }
Esempio n. 11
0
        public void trexAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> trexAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.trex)
                {
                    trexAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.Skunk,
                AlgorithmType.X16R,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.trex, primaryAlgorithm);
                Assert.IsTrue(trexAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(2, trexAlgorithms.Count);

            trexAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.trex)
                {
                    trexAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, trexAlgorithms.Count);
        }
Esempio n. 12
0
        public void EWBFAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> ewbfAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.EWBF)
                {
                    ewbfAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.ZHash,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.EWBF, primaryAlgorithm);
                Assert.IsTrue(ewbfAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(1, ewbfAlgorithms.Count);
            Assert.IsTrue(ewbfAlgorithms[0].Enabled);

            ewbfAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.EWBF)
                {
                    ewbfAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, ewbfAlgorithms.Count);
        }
Esempio n. 13
0
 public void SetAlgorithmDeviceConfig(DeviceBenchmarkConfig config)
 {
     if (config != null && config.DeviceUUID == Uuid && config.AlgorithmSettings != null)
     {
         AlgorithmSettings = DefaultAlgorithms.GetAlgorithmsForDevice(this);
         foreach (var conf in config.AlgorithmSettings)
         {
             var setAlgo = GetAlgorithm(conf.MinerBaseType, conf.NiceHashID, conf.SecondaryNiceHashID);
             if (setAlgo != null)
             {
                 setAlgo.BenchmarkSpeed        = conf.BenchmarkSpeed;
                 setAlgo.ExtraLaunchParameters = conf.ExtraLaunchParameters;
                 setAlgo.Enabled     = conf.Enabled;
                 setAlgo.LessThreads = conf.LessThreads;
                 setAlgo.PowerUsage  = conf.PowerUsage;
                 if (setAlgo is DualAlgorithm dualSA)
                 {
                     dualSA.SecondaryBenchmarkSpeed = conf.SecondaryBenchmarkSpeed;
                     var dualConf = config.DualAlgorithmSettings?.Find(a =>
                                                                       a.SecondaryNiceHashID == dualSA.SecondaryNiceHashID);
                     if (dualConf != null)
                     {
                         dualConf.FixSettingsBounds();
                         dualSA.IntensitySpeeds          = dualConf.IntensitySpeeds;
                         dualSA.SecondaryIntensitySpeeds = dualConf.SecondaryIntensitySpeeds;
                         dualSA.TuningEnabled            = dualConf.TuningEnabled;
                         dualSA.TuningStart        = dualConf.TuningStart;
                         dualSA.TuningEnd          = dualConf.TuningEnd;
                         dualSA.TuningInterval     = dualConf.TuningInterval;
                         dualSA.IntensityPowers    = dualConf.IntensityPowers;
                         dualSA.UseIntensityPowers = dualConf.UseIntensityPowers;
                     }
                 }
             }
         }
     }
 }
Esempio n. 14
0
        public void PhoenixAlgorithmsForDevice_Tests()
        {
            var device        = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(device);
            List <Algorithm> phoenixAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.Phoenix)
                {
                    phoenixAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.DaggerHashimoto,
            };

            foreach (var secondaryAlgorithm in secondaryList) //check to see if all algorithms from secondary list are in algorithms (dual with dager)
            {
                var algo = new Algorithm(MinerBaseType.Phoenix, secondaryAlgorithm);
                Assert.IsTrue(phoenixAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }

            phoenixAlgorithms.Clear();
            device        = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(device);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.Phoenix)
                {
                    phoenixAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, phoenixAlgorithms.Count);
        }
Esempio n. 15
0
        public void ccminerAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> ccminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.ccminer || algorithm.MinerBaseType == MinerBaseType.ccminer_alexis)
                {
                    ccminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.NeoScrypt,
                AlgorithmType.Blake2s,
                AlgorithmType.Keccak,
                AlgorithmType.Skunk,
                AlgorithmType.X16R,
                AlgorithmType.Lyra2REv3,
                AlgorithmType.MTP,
                AlgorithmType.Keccak, //ccminer_alexis
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.ccminer, primaryAlgorithm);
                Assert.IsTrue(ccminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(8, ccminerAlgorithms.Count);

            ccminerAlgorithms.Clear(); //major number = 3
            cudaDev       = cudaComputeDev3Major();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.ccminer || algorithm.MinerBaseType == MinerBaseType.ccminer_alexis)
                {
                    ccminerAlgorithms.Add(algorithm);
                }
            }
            secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.Blake2s,
                AlgorithmType.Keccak,
                AlgorithmType.Skunk,
                AlgorithmType.X16R,
                AlgorithmType.MTP,
                AlgorithmType.Keccak, //ccminer_alexis
            };
            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.ccminer, primaryAlgorithm);
                Assert.IsTrue(ccminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(6, ccminerAlgorithms.Count);

            ccminerAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.ccminer || algorithm.MinerBaseType == MinerBaseType.ccminer_alexis)
                {
                    ccminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, ccminerAlgorithms.Count);
        }
Esempio n. 16
0
        public void sgminerAlgorithmsForDevice_tests()
        {
            var openCLDevice  = amdComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            List <Algorithm> sgminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.sgminer)
                {
                    sgminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.NeoScrypt,
                AlgorithmType.Pascal,
                AlgorithmType.Keccak,
                AlgorithmType.DaggerHashimoto,
                AlgorithmType.X16R,
            };

            foreach (var secondaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.sgminer, secondaryAlgorithm);
                Assert.IsTrue(sgminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(5, sgminerAlgorithms.Count);

            sgminerAlgorithms.Clear(); //amd gpu ram too low
            openCLDevice  = amdComputeDevLowRAM();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.sgminer)
                {
                    sgminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(4, sgminerAlgorithms.Count);

            sgminerAlgorithms.Clear(); //bad amd drivers
            openCLDevice  = amdComputeDevDriverDisabled();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.sgminer)
                {
                    sgminerAlgorithms.Add(algorithm);
                }
            }
            secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.Pascal,
                AlgorithmType.Keccak,
                AlgorithmType.DaggerHashimoto,
                AlgorithmType.X16R,
            };
            foreach (var secondaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.sgminer, secondaryAlgorithm);
                Assert.IsTrue(sgminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(4, sgminerAlgorithms.Count);

            sgminerAlgorithms.Clear(); //cuda device
            var cudaDevice = cudaComputeDev();

            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.sgminer)
                {
                    sgminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, sgminerAlgorithms.Count);
        }
Esempio n. 17
0
        public void BMinerAlgorithmsForDevice_tests()
        {
            var cudaDev       = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            List <Algorithm> bminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.BMiner)
                {
                    bminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.ZHash,
                AlgorithmType.DaggerHashimoto,
                AlgorithmType.Beam,
                AlgorithmType.GrinCuckaroo29,
            };

            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.BMiner, primaryAlgorithm);
                Assert.IsTrue(bminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(4, bminerAlgorithms.Count);
            foreach (var algo in bminerAlgorithms)
            {
                Assert.IsFalse(algo.Enabled);
            }

            bminerAlgorithms.Clear(); //low ram
            cudaDev       = cudaComputeDevLowRam();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.BMiner)
                {
                    bminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(1, bminerAlgorithms.Count);
            Assert.AreEqual(AlgorithmType.ZHash, bminerAlgorithms[0].NiceHashID);

            bminerAlgorithms.Clear(); //low major
            cudaDev       = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDev);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.BMiner)
                {
                    bminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, bminerAlgorithms.Count);

            bminerAlgorithms.Clear(); //amd device
            var openCLDevice = amdComputeDev();

            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.BMiner)
                {
                    bminerAlgorithms.Add(algorithm);
                }
            }
            secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.Beam,
            };
            foreach (var primaryAlgorithm in secondaryList)
            {
                var algo = new Algorithm(MinerBaseType.BMiner, primaryAlgorithm);
                Assert.IsTrue(bminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }
            Assert.AreEqual(1, bminerAlgorithms.Count);
            Assert.AreEqual(AlgorithmType.Beam, bminerAlgorithms[0].NiceHashID);

            bminerAlgorithms.Clear(); //amd low gcn
            openCLDevice  = amdComputeDevLowGCN();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.BMiner)
                {
                    bminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, bminerAlgorithms.Count);
        }
Esempio n. 18
0
        public void GMinerAlgorithmsForDevice_Tests()
        {
            var cudaDevice    = cudaComputeDev();
            var allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDevice);
            List <Algorithm> gminerAlgorithms = new List <Algorithm>();

            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.GMiner)
                {
                    gminerAlgorithms.Add(algorithm);
                }
            }
            var secondaryList = new List <AlgorithmType>
            {
                AlgorithmType.ZHash,
                AlgorithmType.Beam,
                AlgorithmType.GrinCuckaroo29,
            };

            foreach (var secondaryAlgorithm in secondaryList) //check to see if all algorithms from secondary list are in algorithms (dual with dager)
            {
                var algo = new Algorithm(MinerBaseType.GMiner, secondaryAlgorithm);
                Assert.IsTrue(gminerAlgorithms.Any(a => algo.NiceHashID == a.NiceHashID));
            }

            gminerAlgorithms.Clear();
            cudaDevice    = cudaComputeDevLowMajor();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(cudaDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.GMiner)
                {
                    gminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, gminerAlgorithms.Count);

            gminerAlgorithms.Clear(); //amd vega device
            var openCLDevice = amdComputeDev();

            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.GMiner)
                {
                    gminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(1, gminerAlgorithms.Count);
            Assert.AreEqual(AlgorithmType.Beam, gminerAlgorithms[0].NiceHashID);

            gminerAlgorithms.Clear(); //amd GCN too low
            openCLDevice  = amdComputeDevLowGCN();
            allAlgorithms = DefaultAlgorithms.GetAlgorithmsForDevice(openCLDevice);
            foreach (var algorithm in allAlgorithms)
            {
                if (algorithm.MinerBaseType == MinerBaseType.GMiner)
                {
                    gminerAlgorithms.Add(algorithm);
                }
            }
            Assert.AreEqual(0, gminerAlgorithms.Count);
        }