diff --git a/NiceHashMiner/Devices/AmdGpuDevice.cs b/NiceHashMiner/Devices/AmdGpuDevice.cs index d7a0f03..25b3d6c 100644 --- a/NiceHashMiner/Devices/AmdGpuDevice.cs +++ b/NiceHashMiner/Devices/AmdGpuDevice.cs @@ -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 diff --git a/NiceHashMiner/Devices/ComputeDevice.cs b/NiceHashMiner/Devices/ComputeDevice.cs index 2e076d4..852178b 100644 --- a/NiceHashMiner/Devices/ComputeDevice.cs +++ b/NiceHashMiner/Devices/ComputeDevice.cs @@ -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 AlgorithmSettings { get; set; } @@ -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 diff --git a/NiceHashMiner/Devices/ComputeDeviceManager.cs b/NiceHashMiner/Devices/ComputeDeviceManager.cs index 9830ef3..216fe47 100644 --- a/NiceHashMiner/Devices/ComputeDeviceManager.cs +++ b/NiceHashMiner/Devices/ComputeDeviceManager.cs @@ -521,6 +521,7 @@ static public void QueryAMD() { #region AMD driver check, ADL returns 0 // check the driver version bool EnableOptimizedVersion = true; Dictionary deviceDriverOld = new Dictionary(); + Dictionary deviceDriverNO_neoscrypt_lyra2re = new Dictionary(); string minerPath = MinerPaths.sgminer_5_5_0_general; bool ShowWarningDialog = false; @@ -528,10 +529,19 @@ static public void QueryAMD() { 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; @@ -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; @@ -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; diff --git a/NiceHashMiner/Devices/GroupAlgorithms.cs b/NiceHashMiner/Devices/GroupAlgorithms.cs index c341ccb..14cb2d9 100644 --- a/NiceHashMiner/Devices/GroupAlgorithms.cs +++ b/NiceHashMiner/Devices/GroupAlgorithms.cs @@ -76,6 +76,16 @@ public static Dictionary CreateForDevice(ComputeDevice } } } + + // drivers algos issue + if (device.DriverDisableAlgos) { + List _3rdPartyOnlyAlgos = new List() { AlgorithmType.NeoScrypt, AlgorithmType.Lyra2REv2 }; + foreach (var algoType in _3rdPartyOnlyAlgos) { + if (algoSettings.ContainsKey(algoType)) { + algoSettings.Remove(algoType); + } + } + } } // check if it is Etherum capable