Example #1
0
        public async Task DevicesCrossReference(IEnumerable <BaseDevice> devices)
        {
            if (_mappedDeviceIds.Count == 0)
            {
                return;
            }

            var(minerBinPath, minerCwdPath) = GetBinAndCwdPaths();
            var output = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--list-devices --nocolor=on");

            var ts       = DateTime.UtcNow.Ticks;
            var dumpFile = $"d{ts}.txt";

            try
            {
                File.WriteAllText(Path.Combine(minerCwdPath, dumpFile), output);
            }
            catch (Exception e)
            {
                Logger.Error("LolMinerPlugin", $"DevicesCrossReference error creating dump file ({dumpFile}): {e.Message}");
            }
            var mappedDevs = DevicesListParser.ParseLolMinerOutput(output, devices.ToList());

            foreach (var(uuid, minerGpuId) in mappedDevs)
            {
                Logger.Info("LolMinerPlugin", $"DevicesCrossReference '{uuid}' => {minerGpuId}");
                _mappedDeviceIds[uuid] = minerGpuId;
            }
        }
        public async Task DevicesCrossReference(IEnumerable<BaseDevice> devices)
        {
            if (_mappedDeviceIds.Count == 0) return;
            // will block
            var minerBinPath = GetBinAndCwdPaths().Item1;
            var output = await DevicesCrossReferenceHelpers.MinerOutput(minerBinPath, "--benchmark BEAM --longstats 60 --devices -1", new List<string> { "Start Benchmark..." });
            var mappedDevs = DevicesListParser.ParseLolMinerOutput(output, devices.ToList());

            foreach (var kvp in mappedDevs)
            {
                var uuid = kvp.Key;
                var indexID = kvp.Value;
                _mappedDeviceIds[uuid] = indexID;
            }
        }