Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
AMD algorithm list - sgminer driver exception checking
Browse files Browse the repository at this point in the history
  • Loading branch information
S74nk0 committed Jan 17, 2017
1 parent ed656ee commit b38ab44
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
6 changes: 5 additions & 1 deletion NiceHashMiner/Devices/AmdGpuDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ public class AmdGpuDevice {
private OpenCLDevice _openClSubset;
public readonly string InfSection; // has arhitecture string

// new drivers make some algorithms unusable 21.19.164.1 => driver not working with NeoScrypt and
public bool DriverDisableAlgos { get; private set; }

public string Codename { get { return _openClSubset._CL_DEVICE_NAME; } }

public AmdGpuDevice(OpenCLDevice openClSubset, bool isOldDriver, string infSection) {
public AmdGpuDevice(OpenCLDevice openClSubset, bool isOldDriver, string infSection, bool driverDisableAlgo) {
DriverDisableAlgos = driverDisableAlgo;
InfSection = infSection;
_openClSubset = openClSubset;
// Check for optimized version
Expand Down
3 changes: 3 additions & 0 deletions NiceHashMiner/Devices/ComputeDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class ComputeDevice
public readonly bool IsOptimizedVersion;
public readonly string Codename;
public readonly string InfSection;
// amd has some algos not working with new drivers
public readonly bool DriverDisableAlgos;

//public DeviceBenchmarkConfig_rem DeviceBenchmarkConfig { get; private set; }
public Dictionary<AlgorithmType, Algorithm> AlgorithmSettings { get; set; }
Expand Down Expand Up @@ -107,6 +109,7 @@ public ComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallb
Codename = amdDevice.Codename;
InfSection = amdDevice.InfSection;
AlgorithmSettings = GroupAlgorithms.CreateForDevice(this);
DriverDisableAlgos = amdDevice.DriverDisableAlgos; ;
}

// combines long and short name
Expand Down
14 changes: 12 additions & 2 deletions NiceHashMiner/Devices/ComputeDeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,17 +521,27 @@ static public void QueryAMD() {
#region AMD driver check, ADL returns 0
// check the driver version bool EnableOptimizedVersion = true;
Dictionary<string, bool> deviceDriverOld = new Dictionary<string, bool>();
Dictionary<string, bool> deviceDriverNO_neoscrypt_lyra2re = new Dictionary<string, bool>();
string minerPath = MinerPaths.sgminer_5_5_0_general;
bool ShowWarningDialog = false;

foreach (var vidContrllr in AvaliableVideoControllers) {
Helpers.ConsolePrint(TAG, String.Format("Checking AMD device (driver): {0} ({1})", vidContrllr.Name, vidContrllr.DriverVersion));

deviceDriverOld[vidContrllr.Name] = false;
deviceDriverNO_neoscrypt_lyra2re[vidContrllr.Name] = false;
Version sgminer_NO_neoscrypt_lyra2re = new Version("21.19.164.1");
// TODO checking radeon drivers only?
if ((vidContrllr.Name.Contains("AMD") || vidContrllr.Name.Contains("Radeon")) && ShowWarningDialog == false) {
Version AMDDriverVersion = new Version(vidContrllr.DriverVersion);

bool greaterOrEqual = AMDDriverVersion.CompareTo(sgminer_NO_neoscrypt_lyra2re) >= 0;
if (greaterOrEqual) {
deviceDriverNO_neoscrypt_lyra2re[vidContrllr.Name] = true;
Helpers.ConsolePrint(TAG, "Driver version seems to be " + sgminer_NO_neoscrypt_lyra2re.ToString() + " or higher. NeoScrypt and Lyra2REv2 will be removed from list");
}


if (AMDDriverVersion.Major < 15) {
ShowWarningDialog = true;
deviceDriverOld[vidContrllr.Name] = true;
Expand Down Expand Up @@ -743,7 +753,7 @@ static public void QueryAMD() {
int busID = amdGpus[i_id].AMD_BUS_ID;
if (busID != -1 && _busIdsInfo.ContainsKey(busID)) {
var deviceName = _busIdsInfo[busID].Item1;
var newAmdDev = new AmdGpuDevice(amdGpus[i_id], deviceDriverOld[deviceName], _busIdsInfo[busID].Item3);
var newAmdDev = new AmdGpuDevice(amdGpus[i_id], deviceDriverOld[deviceName], _busIdsInfo[busID].Item3, deviceDriverNO_neoscrypt_lyra2re[deviceName]);
newAmdDev.DeviceName = deviceName;
newAmdDev.UUID = _busIdsInfo[busID].Item2;
bool isDisabledGroup = ConfigManager.GeneralConfig.DeviceDetection.DisableDetectionAMD;
Expand Down Expand Up @@ -794,7 +804,7 @@ static public void QueryAMD() {

var deviceName = AMDVideoControllers[i].Name;
if(AMDVideoControllers[i].InfSection == null) AMDVideoControllers[i].InfSection = "";
var newAmdDev = new AmdGpuDevice(amdGpus[i], deviceDriverOld[deviceName], AMDVideoControllers[i].InfSection);
var newAmdDev = new AmdGpuDevice(amdGpus[i], deviceDriverOld[deviceName], AMDVideoControllers[i].InfSection, deviceDriverNO_neoscrypt_lyra2re[deviceName]);
newAmdDev.DeviceName = deviceName;
newAmdDev.UUID = "UNUSED";
bool isDisabledGroup = ConfigManager.GeneralConfig.DeviceDetection.DisableDetectionAMD;
Expand Down
10 changes: 10 additions & 0 deletions NiceHashMiner/Devices/GroupAlgorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ public static Dictionary<AlgorithmType, Algorithm> CreateForDevice(ComputeDevice
}
}
}

// drivers algos issue
if (device.DriverDisableAlgos) {
List<AlgorithmType> _3rdPartyOnlyAlgos = new List<AlgorithmType>() { AlgorithmType.NeoScrypt, AlgorithmType.Lyra2REv2 };
foreach (var algoType in _3rdPartyOnlyAlgos) {
if (algoSettings.ContainsKey(algoType)) {
algoSettings.Remove(algoType);
}
}
}
}

// check if it is Etherum capable
Expand Down

0 comments on commit b38ab44

Please sign in to comment.