private void prepareConfigFile(string pool, string wallet) { if (this.MiningSetup.MiningPairs.Count > 0) { try { bool IsHyperThreadingEnabled = this.MiningSetup.MiningPairs[0].CurrentExtraLaunchParameters.Contains("enable_ht=true"); int numTr = ExtraLaunchParametersParser.GetThreadsNumber(this.MiningSetup.MiningPairs[0]); if (IsHyperThreadingEnabled) { numTr /= 2; } var config = new XmrStackCPUMinerConfig(numTr, pool, wallet, this.APIPort); var no_prefetch = ExtraLaunchParametersParser.GetNoPrefetch(MiningSetup.MiningPairs[0]); //config.Inti_cpu_threads_conf(false, false, true, ComputeDeviceManager.Avaliable.IsHyperThreadingEnabled); config.Inti_cpu_threads_conf(false, no_prefetch, false, IsHyperThreadingEnabled); var confJson = JObject.FromObject(config); string writeStr = confJson.ToString(); int start = writeStr.IndexOf("{"); int end = writeStr.LastIndexOf("}"); writeStr = writeStr.Substring(start + 1, end - 1); System.IO.File.WriteAllText(WorkingDirectory + GetConfigFileName(), writeStr); } catch { } } }
protected override void prepareConfigFile(string pool, string wallet) { if (this.MiningSetup.MiningPairs.Count > 0) { try { bool IsHyperThreadingEnabled = this.MiningSetup.MiningPairs[0].CurrentExtraLaunchParameters.Contains("enable_ht=true"); int numTr = ExtraLaunchParametersParser.GetThreadsNumber(this.MiningSetup.MiningPairs[0]); if (IsHyperThreadingEnabled) { numTr /= 2; } var cpuconf = new XmrStackCPUMinerConfig(numTr); var no_prefetch = ExtraLaunchParametersParser.GetNoPrefetch(MiningSetup.MiningPairs[0]); //config.Inti_cpu_threads_conf(false, false, true, ComputeDeviceManager.Avaliable.IsHyperThreadingEnabled); cpuconf.Inti_cpu_threads_conf(false, no_prefetch, false, IsHyperThreadingEnabled); var cpuConfJson = JObject.FromObject(cpuconf); string writeStrCPU = cpuConfJson.ToString(); int start = writeStrCPU.IndexOf("{"); int end = writeStrCPU.LastIndexOf("}"); writeStrCPU = writeStrCPU.Substring(start + 1, end - 1); System.IO.File.WriteAllText(WorkingDirectory + "cpu.txt", writeStrCPU); var config = new XmrStackMainMinerConfig(pool, wallet, this.APIPort); var confJson = JObject.FromObject(config); string writeStr = confJson.ToString(); start = writeStr.IndexOf("{"); end = writeStr.LastIndexOf("}"); writeStr = writeStr.Substring(start + 1, end - 1); System.IO.File.WriteAllText(WorkingDirectory + GetConfigFileName(), writeStr); var disableGPU = new XmrDisableGPUConf(); var disableGPUconf = JObject.FromObject(disableGPU); writeStr = disableGPUconf.ToString(); start = writeStr.IndexOf("{"); end = writeStr.LastIndexOf("}"); writeStr = writeStr.Substring(start + 1, end - 1); System.IO.File.WriteAllText(WorkingDirectory + "nvidia.txt", writeStr); System.IO.File.WriteAllText(WorkingDirectory + "amd.txt", writeStr); } catch (Exception e) { Debug.WriteLine(e.Message); } } }