private List <OpenCLDevice> AmdDeviceCreationPrimary(List <OpenCLDevice> amdDevices) { Helpers.ConsolePrint(Tag, "Using AMD device creation DEFAULT Reliable mappings"); Helpers.ConsolePrint(Tag, amdDevices.Count == _amdDeviceUuid.Count ? "AMD OpenCL and ADL AMD query COUNTS GOOD/SAME" : "AMD OpenCL and ADL AMD query COUNTS DIFFERENT/BAD"); var stringBuilder = new StringBuilder(); stringBuilder.AppendLine(""); stringBuilder.AppendLine("QueryAMD [DEFAULT query] devices: "); foreach (var dev in amdDevices) { ComputeDeviceManager.Available.HasAmd = true; var busID = dev.AMD_BUS_ID; if (busID != -1 && _busIdInfos.ContainsKey(busID)) { var deviceName = _busIdInfos[busID].Name; var newAmdDev = new AmdGpuDevice(dev, _driverOld[deviceName], _busIdInfos[busID].InfSection, _noNeoscryptLyra2[deviceName]) { DeviceName = deviceName, UUID = _busIdInfos[busID].Uuid, AdapterIndex = _busIdInfos[busID].Adl1Index }; var isDisabledGroup = ConfigManager.GeneralConfig.DeviceDetection .DisableDetectionAMD; var skipOrAdd = isDisabledGroup ? "SKIPED" : "ADDED"; var isDisabledGroupStr = isDisabledGroup ? " (AMD group disabled)" : ""; var etherumCapableStr = newAmdDev.IsEtherumCapable() ? "YES" : "NO"; ComputeDeviceManager.Available.Devices.Add( new AmdComputeDevice(newAmdDev, ++ComputeDeviceManager.Query.GpuCount, false, _busIdInfos[busID].Adl2Index)); // just in case try { stringBuilder.AppendLine($"\t{skipOrAdd} device{isDisabledGroupStr}:"); stringBuilder.AppendLine($"\t\tID: {newAmdDev.DeviceID}"); stringBuilder.AppendLine($"\t\tNAME: {newAmdDev.DeviceName}"); stringBuilder.AppendLine($"\t\tCODE_NAME: {newAmdDev.Codename}"); stringBuilder.AppendLine($"\t\tUUID: {newAmdDev.UUID}"); stringBuilder.AppendLine( $"\t\tMEMORY: {newAmdDev.DeviceGlobalMemory}"); stringBuilder.AppendLine($"\t\tETHEREUM: {etherumCapableStr}"); } catch { } } else { stringBuilder.AppendLine($"\tDevice not added, Bus No. {busID} not found:"); } } Helpers.ConsolePrint(Tag, stringBuilder.ToString()); return(amdDevices); }
private List <OpenCLDevice> AmdDeviceCreationFallback(List <OpenCLDevice> amdDevices) { Helpers.ConsolePrint(Tag, "Using AMD device creation FALLBACK UnReliable mappings"); var stringBuilder = new StringBuilder(); stringBuilder.AppendLine(""); stringBuilder.AppendLine("QueryAMD [FALLBACK query] devices: "); // get video AMD controllers and sort them by RAM // (find a way to get PCI BUS Numbers from PNPDeviceID) var amdVideoControllers = _availableControllers.Where(vcd => vcd.Name.ToLower().Contains("amd") || vcd.Name.ToLower().Contains("radeon") || vcd.Name.ToLower().Contains("firepro")).ToList(); // sort by ram not ideal amdVideoControllers.Sort((a, b) => (int)(a.AdapterRam - b.AdapterRam)); amdDevices.Sort((a, b) => (int)(a._CL_DEVICE_GLOBAL_MEM_SIZE - b._CL_DEVICE_GLOBAL_MEM_SIZE)); var minCount = Math.Min(amdVideoControllers.Count, amdDevices.Count); for (var i = 0; i < minCount; ++i) { ComputeDeviceManager.Available.HasAmd = true; var deviceName = amdVideoControllers[i].Name; if (amdVideoControllers[i].InfSection == null) { amdVideoControllers[i].InfSection = ""; } var newAmdDev = new AmdGpuDevice(amdDevices[i], _driverOld[deviceName], amdVideoControllers[i].InfSection, _noNeoscryptLyra2[deviceName]) { DeviceName = deviceName, UUID = "UNUSED" }; var isDisabledGroup = ConfigManager.GeneralConfig.DeviceDetection .DisableDetectionAMD; var skipOrAdd = isDisabledGroup ? "SKIPED" : "ADDED"; var isDisabledGroupStr = isDisabledGroup ? " (AMD group disabled)" : ""; var etherumCapableStr = newAmdDev.IsEtherumCapable() ? "YES" : "NO"; ComputeDeviceManager.Available.Devices.Add( new AmdComputeDevice(newAmdDev, ++ComputeDeviceManager.Query.GpuCount, true, -1)); // just in case try { stringBuilder.AppendLine($"\t{skipOrAdd} device{isDisabledGroupStr}:"); stringBuilder.AppendLine($"\t\tID: {newAmdDev.DeviceID}"); stringBuilder.AppendLine($"\t\tNAME: {newAmdDev.DeviceName}"); stringBuilder.AppendLine($"\t\tCODE_NAME: {newAmdDev.Codename}"); stringBuilder.AppendLine($"\t\tUUID: {newAmdDev.UUID}"); stringBuilder.AppendLine( $"\t\tMEMORY: {newAmdDev.DeviceGlobalMemory}"); stringBuilder.AppendLine($"\t\tETHEREUM: {etherumCapableStr}"); } catch { } } Helpers.ConsolePrint(Tag, stringBuilder.ToString()); return(amdDevices); }