Skip to content

Commit

Permalink
t-rex ergo
Browse files Browse the repository at this point in the history
  • Loading branch information
angelbbs committed Jul 12, 2021
1 parent bc7726b commit ea6dee3
Show file tree
Hide file tree
Showing 30 changed files with 770 additions and 202 deletions.
Binary file modified LatestBuild/nhmlffLatest.zip
Binary file not shown.
57 changes: 54 additions & 3 deletions NiceHashMiner/Algorithms/Algorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class Algorithm
/// Hashrate in H/s set by benchmark or user
/// </summary>
public virtual double BenchmarkSpeed { get; set; }
public virtual double BenchmarkSecondarySpeed { get; set; }
/// <summary>
/// Gets the averaged speed for this algorithm in H/s
/// <para>When multiple devices of the same model are used, this will be set to their averaged hashrate</para>
Expand Down Expand Up @@ -182,19 +183,56 @@ public string CurPayingRatio
return ratio;
}
}

public string CurSecondPayingRatio
{
get
{
var ratio = International.GetText("BenchmarkRatioRateN_A");
if (NiceHashID == AlgorithmType.Autolykos && SecondaryNiceHashID == AlgorithmType.DaggerHashimoto && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var paying))//ZIL
{
ratio = (paying / 30).ToString("F8");
}
else if (NHSmaData.TryGetPaying(SecondaryNiceHashID, out var paying2))
{
ratio = paying2.ToString("F8");
}
return ratio;
}
}
public virtual string CurPayingRate
{
get
{
/*
var rate = International.GetText("BenchmarkRatioRateN_A");
if (BenchmarkSpeed > 0 && NHSmaData.TryGetPaying(NiceHashID, out var paying))
{
var payingRate = BenchmarkSpeed * paying * Mult;
rate = payingRate.ToString("F8");
}

*/
var rate = International.GetText("BenchmarkRatioRateN_A");
var payingRate = 0.0d;

if (BenchmarkSpeed > 0 && NHSmaData.TryGetPaying(NiceHashID, out var paying))
{
payingRate += BenchmarkSpeed * paying * Mult;
rate = payingRate.ToString("F8");
}

if (NiceHashID == AlgorithmType.Autolykos && SecondaryNiceHashID == AlgorithmType.DaggerHashimoto && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var secPaying2))//ZIL
{

payingRate += BenchmarkSecondarySpeed * (secPaying2 / 30) * Mult;
rate = payingRate.ToString("F8");
}
else if (BenchmarkSecondarySpeed > 0 && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var secPaying))
{
payingRate += BenchmarkSecondarySpeed * secPaying * Mult;
rate = payingRate.ToString("F8");
}

return rate;
}
set
Expand Down Expand Up @@ -260,6 +298,19 @@ public string BenchmarkSpeedString()
}
return International.GetText("BenchmarkSpeedStringNone");
}
public string SecondaryBenchmarkSpeedString()
{
if (BenchmarkSecondarySpeed > 0)
{
return Helpers.FormatDualSpeedOutput(BenchmarkSecondarySpeed, 0, DualNiceHashID);
}
//if (!IsPendingString() && !string.IsNullOrEmpty(BenchmarkStatus))
if (!string.IsNullOrEmpty(BenchmarkStatus) && BenchmarkActive)
{
return BenchmarkStatus;
}
return International.GetText("BenchmarkSpeedStringNone");
}

#endregion

Expand Down
38 changes: 16 additions & 22 deletions NiceHashMiner/Algorithms/DualAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public SortedSet<int> AllIntensities
/// Primary hashrate in H/s set by benchmark or user
/// <para>If tuning is enabled, returns the hashrate from the most profitable intensity</para>
/// </summary>
///
/*
public override double BenchmarkSpeed
{
get
Expand All @@ -172,12 +174,13 @@ public override double BenchmarkSpeed
return base.BenchmarkSpeed;
}
}

*/
private double _secondaryBenchmarkSpeed;
/// <summary>
/// Secondary hashrate in H/s set by benchmark or user
/// <para>If tuning is enabled, returns the hashrate from the most profitable intensity</para>
/// </summary>
/*
public double SecondaryBenchmarkSpeed
{
get
Expand All @@ -200,6 +203,7 @@ public double SecondaryBenchmarkSpeed
}
set => _secondaryBenchmarkSpeed = value;
}
*/

/// <summary>
/// Gets the secondary averaged speed for this algorithm in H/s
Expand All @@ -210,6 +214,7 @@ public double SecondaryBenchmarkSpeed
/// <summary>
/// Indicates whether this algorithm requires a benchmark
/// </summary>
/*
public override bool BenchmarkNeeded
{
get
Expand All @@ -229,7 +234,7 @@ public override bool BenchmarkNeeded
return false;
}
}

*/
#endregion

#region Power Switching
Expand Down Expand Up @@ -274,15 +279,15 @@ public DualAlgorithm(MinerBaseType minerBaseType, AlgorithmType niceHashID, Algo
SecondaryAlgorithmName = AlgorithmNiceHashNames.GetName(secondaryNiceHashID);
AlgorithmStringID = MinerBaseTypeName + "_" + AlgorithmName;
DualAlgorithmNameCustom = _DualAlgorithmNameCustom;
SecondaryBenchmarkSpeed = 0.0d;
//SecondaryBenchmarkSpeed = 0.0d;

IntensitySpeeds = new Dictionary<int, double>();
SecondaryIntensitySpeeds = new Dictionary<int, double>();
IntensityPowers = new Dictionary<int, double>();
}

#region Benchmark info

/*
public override string CurPayingRate
{
get
Expand Down Expand Up @@ -311,7 +316,8 @@ public override string CurPayingRate
return rate;
}
}

*/
/*
public string SecondaryCurPayingRatio
{
get
Expand All @@ -328,20 +334,8 @@ public string SecondaryCurPayingRatio
return ratio;
}
}
public string SecondaryCurPayingRatioZIL
{
get
{
var ratio = International.GetText("BenchmarkRatioRateN_A");
if (NHSmaData.TryGetPaying(SecondaryNiceHashID, out var paying))
{
ratio = (paying / 30).ToString("F8");
}

return ratio;
}
}

*/
/*
public string SecondaryBenchmarkSpeedString()
{
const string dcriStatus = " (dcri:{0})";
Expand All @@ -358,9 +352,9 @@ public string SecondaryBenchmarkSpeedString()
return International.GetText("BenchmarkSpeedStringNone");
}

*/
#endregion

/*
public override void UpdateCurProfit(Dictionary<AlgorithmType, double> profits)
{
base.UpdateCurProfit(profits);
Expand All @@ -383,7 +377,7 @@ public override void UpdateCurProfit(Dictionary<AlgorithmType, double> profits)
SubtractPowerFromProfit();
}

*/
#region ClaymoreDual Tuning

public void SetIntensitySpeedsForCurrent(double speed, double secondarySpeed)
Expand Down
4 changes: 2 additions & 2 deletions NiceHashMiner/Configs/Data/AlgorithmConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public class AlgorithmConfig
public AlgorithmType NiceHashID = AlgorithmType.NONE;
public AlgorithmType SecondaryNiceHashID = AlgorithmType.NONE;
public MinerBaseType MinerBaseType = MinerBaseType.NONE;
public string AlgorithmNameCustom = ""; // probably not needed
public string AlgorithmNameCustom = "";
public double BenchmarkSpeed = 0;
public double SecondaryBenchmarkSpeed = 0;
public double BenchmarkSecondarySpeed = 0;
public string ExtraLaunchParameters = "";
public bool Enabled = true;
public bool Hidden = false;
Expand Down
2 changes: 2 additions & 0 deletions NiceHashMiner/Configs/Data/GeneralConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class GeneralConfig
public int DaggerHashimoto1070MaxEpoch = 371;
public LanguageType Language = LanguageType.En;
public string DisplayCurrency = "USD";
public bool Show_displayConected = false;
public bool Show_current_actual_profitability = true;
public bool DivertRun = true;
public bool ShowUptime = true;
Expand Down Expand Up @@ -229,6 +230,7 @@ public void SetDefaults()
ProgramMonitoring = true;
AutoStartMining = false;
AutoStartMiningDelay = 0;
Show_displayConected = false;
//LessThreads = 0;
DivertRun = true;
HideMiningWindows = false;
Expand Down
22 changes: 18 additions & 4 deletions NiceHashMiner/Devices/Algorithms/DefaultAlgorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ public static class DefaultAlgorithms
new List<Algorithm>()
{
new Algorithm(MinerBaseType.Nanominer, AlgorithmType.DaggerHashimoto, "DaggerHashimoto")
{
ExtraLaunchParameters = ""
},
new DualAlgorithm(MinerBaseType.Nanominer, AlgorithmType.Autolykos, AlgorithmType.DaggerHashimoto, "Autolykos+Zilliqa")
{
ExtraLaunchParameters = "memTweak=1"
}
Expand Down Expand Up @@ -213,6 +209,20 @@ public static class DefaultAlgorithms

}
},
{
MinerBaseType.Nanominer,
new List<Algorithm>()
{
new Algorithm(MinerBaseType.Nanominer, AlgorithmType.Autolykos, "Autolykos")
{
ExtraLaunchParameters = "memTweak=1"
},
new DualAlgorithm(MinerBaseType.Nanominer, AlgorithmType.Autolykos, AlgorithmType.DaggerHashimoto, "Autolykos+Zilliqa")
{
ExtraLaunchParameters = "memTweak=1"
}
}
},
}.ConcatDictList(All, Gpu);

#endregion
Expand Down Expand Up @@ -247,6 +257,10 @@ public static class DefaultAlgorithms
{
ExtraLaunchParameters = ""
},
new Algorithm(MinerBaseType.trex, AlgorithmType.Autolykos, "Autolykos")
{
ExtraLaunchParameters = "--mt 1"
}
}
},

Expand Down
1 change: 1 addition & 0 deletions NiceHashMiner/Devices/AmdGpuDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class AmdGpuDevice
public string UUID; // init this with the ADL, use PCI_VEN & DEV IDs
//public ulong DeviceGlobalMemory => _openClSubset._CL_DEVICE_GLOBAL_MEM_SIZE;
public ulong DeviceGlobalMemory;
public bool MonitorConnected;

//public bool UseOptimizedVersion { get; private set; }
private readonly OpenCLDevice _openClSubset = new OpenCLDevice();
Expand Down
2 changes: 1 addition & 1 deletion NiceHashMiner/Devices/ComputeDevice/AmdComputeDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public AmdComputeDevice(AmdGpuDevice amdDevice, int gpuCount, bool isDetectionFa
amdDevice.IsEtherumCapable(),
DeviceType.AMD,
string.Format(International.GetText("ComputeDevice_Short_Name_AMD_GPU"), gpuCount),
amdDevice.DeviceGlobalMemory, amdDevice.AMDManufacturer)
amdDevice.DeviceGlobalMemory, amdDevice.AMDManufacturer, amdDevice.MonitorConnected)
{
Uuid = isDetectionFallback
? GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType)
Expand Down
4 changes: 2 additions & 2 deletions NiceHashMiner/Devices/ComputeDevice/CPUComputeDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ public override double PowerUsage
}
}

public CpuComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int cpuCount)
public CpuComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int cpuCount, bool monitorconnected = false)
: base(id,
name,
true,
DeviceGroupType.CPU,
false,
DeviceType.CPU,
string.Format(International.GetText("ComputeDevice_Short_Name_CPU"), cpuCount),
0, "")
0, "", monitorconnected)
{
group = "";
Threads = threads;
Expand Down
Loading

0 comments on commit ea6dee3

Please sign in to comment.