Skip to content

Commit

Permalink
63
Browse files Browse the repository at this point in the history
  • Loading branch information
angelbbs committed Apr 2, 2024
1 parent c275e60 commit 90cd560
Show file tree
Hide file tree
Showing 26 changed files with 955 additions and 407 deletions.
Binary file modified LatestBuild/nhmlffLatest.zip
Binary file not shown.
20 changes: 20 additions & 0 deletions NiceHashMiner/Algorithms/DualAlgorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ public override AlgorithmType DualNiceHashID
{
case AlgorithmType.IronFish:
return AlgorithmType.DaggerIronFish;
case AlgorithmType.Alephium:
return AlgorithmType.DaggerAlephium;
case AlgorithmType.KarlsenHash:
return AlgorithmType.DaggerKarlsenHash;
}
}
if (NiceHashID == AlgorithmType.FishHash)
{
switch (SecondaryNiceHashID)
{
case AlgorithmType.Alephium:
return AlgorithmType.FishHashAlephium;
case AlgorithmType.KarlsenHash:
return AlgorithmType.FishHashKarlsenHash;
}
}
if (NiceHashID == AlgorithmType.Autolykos)
Expand All @@ -47,6 +61,8 @@ public override AlgorithmType DualNiceHashID
return AlgorithmType.AutolykosIronFish;
case AlgorithmType.KarlsenHash:
return AlgorithmType.AutolykosKarlsenHash;
case AlgorithmType.Alephium:
return AlgorithmType.AutolykosAlephium;
}
}
if (NiceHashID == AlgorithmType.Octopus)
Expand All @@ -57,6 +73,8 @@ public override AlgorithmType DualNiceHashID
return AlgorithmType.OctopusIronFish;
case AlgorithmType.KarlsenHash:
return AlgorithmType.OctopusKarlsenHash;
case AlgorithmType.Alephium:
return AlgorithmType.OctopusAlephium;
}
}
if (NiceHashID == AlgorithmType.ETCHash)
Expand All @@ -67,6 +85,8 @@ public override AlgorithmType DualNiceHashID
return AlgorithmType.ETCHashIronFish;
case AlgorithmType.KarlsenHash:
return AlgorithmType.ETCHashKarlsenHash;
case AlgorithmType.Alephium:
return AlgorithmType.ETCHashAlephium;
}
}

Expand Down
169 changes: 137 additions & 32 deletions NiceHashMiner/Devices/Algorithms/DefaultAlgorithms.cs

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions NiceHashMiner/Devices/Algorithms/GroupAlgorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ public static class GroupAlgorithms
});
}

if (device.GpuRam < (ulong)(1024 * 1024 * 1024 * 5.8))
{
algoSettings = FilterMinerAlgos(algoSettings, new List<AlgorithmType>
{
AlgorithmType.FishHash
});
}
if (device.GpuRam < (ulong)(1024 * 1024 * 1024 * 5.8))
{
algoSettings = FilterMinerAlgos(algoSettings, new List<AlgorithmType>
{
AlgorithmType.FishHashAlephium
});
}
if (device.GpuRam < (ulong)(1024 * 1024 * 1024 * 5.8))
{
algoSettings = FilterMinerAlgos(algoSettings, new List<AlgorithmType>
{
AlgorithmType.FishHashKarlsenHash
});
}

if (algoSettings.ContainsKey(MinerBaseType.GMiner))
{
if (device.DeviceType == DeviceType.NVIDIA)
Expand Down
11 changes: 0 additions & 11 deletions NiceHashMiner/Devices/ComputeDevice/CPUComputeDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace NiceHashMiner.Devices
[Serializable]
public class CpuComputeDevice : ComputeDevice
{
//private readonly PerformanceCounter _cpuCounter;
private static int cpuLoad = 0;
private static float cpuTemp = -1;
private static PerformanceCounter cpuCounter = new PerformanceCounter();
Expand Down Expand Up @@ -111,7 +110,6 @@ public override float Temp
}
catch (Exception)
{
// Helpers.ConsolePrint("CPUDIAG", e.ToString());
}
} else
{
Expand Down Expand Up @@ -188,7 +186,6 @@ public override double PowerUsage
Helpers.ConsolePrint("CPUDIAG", e.ToString());
}
}
//Helpers.ConsolePrint("CPUDIAG", GetPower().ToString());
return -1;
}
}
Expand Down Expand Up @@ -224,14 +221,6 @@ public CpuComputeDevice(int id, string group, string name, int threads, ulong af
else NewUuid = "0";
AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this);
Index = ID; // Don't increment for CPU
/*
_cpuCounter = new PerformanceCounter
{
CategoryName = "Processor",
CounterName = "% Processor Time",
InstanceName = "_Total"
};
*/
}
}

Expand Down
43 changes: 9 additions & 34 deletions NiceHashMiner/Devices/ComputeDevice/CPUReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ namespace ComputeDeviceCPU
{
public class CpuReader
{
private static readonly Computer _computer = new Computer { IsCpuEnabled = true };
private static readonly Computer _mainboard = new Computer { IsMotherboardEnabled = true };

public static int GetTemperaturesInCelsius()
{
int _ret = -1;
_mainboard.Open();
var coreAndTemperature = new Dictionary<string, float>();
if (Form_Main.thisComputer is not object) return -1;
if (Form_Main.thisComputer.Hardware == null) return -1;

foreach (var hardware in Form_Main.thisComputer.Hardware)
{
foreach (var sensor in hardware.Sensors)
{
if (sensor.SensorType == SensorType.Temperature && sensor.Value.HasValue)
{
//Helpers.ConsolePrint("LHM Temperature", sensor.Name + " = " + sensor.Value.ToString());
if (sensor.Name == "CPU Package" || sensor.Name.Contains("Core ("))
{
_ret = (int)sensor.Value.Value;
Expand All @@ -37,8 +33,8 @@ public static int GetTemperaturesInCelsius()
public static int GetPower()
{
int _ret = -1;
_mainboard.Open();
var coreAndTemperature = new Dictionary<string, float>();
if (Form_Main.thisComputer is not object) return -1;
if (Form_Main.thisComputer.Hardware == null) return -1;
try
{
foreach (var hardware in Form_Main.thisComputer.Hardware)
Expand All @@ -47,7 +43,6 @@ public static int GetPower()
{
if (sensor.SensorType == SensorType.Power && sensor.Value.HasValue)
{
//Helpers.ConsolePrint("LHM Power", sensor.Name + " = " + sensor.Value.ToString());
if (sensor.Name == "CPU Package" || sensor.Name == "Package")
{
_ret = (int)sensor.Value;
Expand All @@ -66,21 +61,16 @@ public static int GetPower()
public static int GetFan()
{
int _ret = -1;
_mainboard.Open();
var coreAndTemperature = new Dictionary<string, float>();
if (_mainboard.Hardware == null) return -1;
foreach (var hardware in _mainboard.Hardware)
if (Form_Main.thisComputer is not object) return -1;
if (Form_Main.thisComputer.Hardware == null) return -1;
foreach (var hardware in Form_Main.thisComputer.Hardware)
{
//hardware.Update(); //use hardware.Name to get CPU model

if (hardware.HardwareType == HardwareType.Motherboard)
{
hardware.Update();
foreach (var sensor in hardware.SubHardware)
{
sensor.Update();
//Helpers.ConsolePrint("LHM", sensor.Name + " " + HardwareType.SuperIO.ToString());

if (sensor.HardwareType == HardwareType.SuperIO)
{
foreach (var superio in hardware.SubHardware)
Expand All @@ -90,7 +80,6 @@ public static int GetFan()
{
if (sens2.SensorType == SensorType.Fan)
{
//Helpers.ConsolePrint("LHM Fan", sens2.Name + " = " + sens2.Value.ToString());
if (sens2.Name == "Fan #1" || sens2.Name == "Fan #2" || sens2.Name == "CPU Fan")
{
_ret = (int)sens2.Value;
Expand All @@ -106,19 +95,17 @@ public static int GetFan()
}
public static int GetLoad()
{
// _computer = new Computer { CPUEnabled = true };
int _ret = -1;
var coreAndTemperature = new Dictionary<string, float>();
if (Form_Main.thisComputer is not object) return -1;
if (Form_Main.thisComputer.Hardware == null) return -1;
try
{
foreach (var hardware in Form_Main.thisComputer.Hardware)
{
//hardware.Update(); //use hardware.Name to get CPU model
foreach (var sensor in hardware.Sensors)
{
if (sensor.SensorType == SensorType.Load && sensor.Value.HasValue)
{
//Helpers.ConsolePrint("CPU", sensor.Name + " " + sensor.Value.ToString());
if (sensor.Name == "Package" || sensor.Name == "CPU Total")
{
_ret = (int)sensor.Value.Value;
Expand All @@ -132,18 +119,6 @@ public static int GetLoad()
}
return _ret;
}

public void Dispose()
{
try
{
_computer.Close();
}
catch (Exception)
{
//ignore closing errors
}
}
}

}
14 changes: 11 additions & 3 deletions NiceHashMiner/Devices/MSIAfterburner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public static void FirstInitFiles()
foreach (var dev in Available.Devices)
{
waiting.SetText("", "Initializing " + dev.Name);
if (dev.DeviceType != DeviceType.CPU)
if (dev.DeviceType != DeviceType.CPU && dev.DeviceType != DeviceType.INTEL)
{
foreach (var alg in dev.GetAlgorithmSettings())
{
Expand Down Expand Up @@ -394,7 +394,7 @@ public static void InitTempFiles()
{
CheckMSIAfterburner();
foreach (var dev in Available.Devices)
if (dev.DeviceType != DeviceType.CPU)
if (dev.DeviceType != DeviceType.CPU && dev.DeviceType != DeviceType.INTEL)
{
foreach (var alg in dev.GetAlgorithmSettings())
{
Expand Down Expand Up @@ -422,7 +422,7 @@ public static void CopyFromTempFiles()
{
CheckMSIAfterburner();
foreach (var dev in Available.Devices)
if (dev.DeviceType != DeviceType.CPU)
if (dev.DeviceType != DeviceType.CPU && dev.DeviceType != DeviceType.INTEL)
{
foreach (var alg in dev.GetAlgorithmSettings())
{
Expand Down Expand Up @@ -456,6 +456,7 @@ public static ControlMemoryGpuEntry GetDeviceData(int _busID)
var devData = new ControlMemoryGpuEntry();
for (int i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down Expand Up @@ -532,6 +533,7 @@ public static void ResetDef(int _busID)
var devType = new DeviceType();
for (int i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down Expand Up @@ -582,6 +584,7 @@ public static bool ResetCurveLock(int _busID, bool commit = false)
int i = 0;
for (i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down Expand Up @@ -647,6 +650,7 @@ public static void ResetToDefaults(int _busID, string uuid = "", string algo = "
int i = 0;
for (i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down Expand Up @@ -779,6 +783,7 @@ public static void SaveDefaultDeviceData(int _busID, string FileName)
int index = -1;
for (int i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down Expand Up @@ -848,6 +853,7 @@ public static bool ApplyFromFile(int _busID, string FileName)

for (i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down Expand Up @@ -902,6 +908,7 @@ public static void CommitChanges(int _busID)
{
for (int i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand All @@ -920,6 +927,7 @@ public static ControlMemoryGpuEntry ReadFromFile(int _busID, string FileName)
{
for (int i = 0; i < macm.Header.GpuEntryCount; i++)
{
if (mahm.GpuEntries[i].Device.Contains("Intel")) continue;
int.TryParse(mahm.GpuEntries[i].GpuId.ToString().Split('&')[4].Replace("BUS_", ""), out int busID);
if (busID == _busID)
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions NiceHashMiner/Forms/Components/AlgorithmsListViewOverClock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ public void SetAlgorithms(ComputeDevice computeDevice, bool isEnabled)
listViewAlgorithms.BeginUpdate();
listViewAlgorithms.Items.Clear();

if (_computeDevice.DeviceType == DeviceType.CPU || _computeDevice.DeviceType == DeviceType.INTEL)
{
labelOverclockNotSupported.Visible = true;
} else
{
labelOverclockNotSupported.Visible = false;
}

foreach (var alg in computeDevice.GetAlgorithmSettings())
{
if (ConfigManager.GeneralConfig.Hide_unused_algorithms && !alg.Enabled)
Expand Down

0 comments on commit 90cd560

Please sign in to comment.