public AmdComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallback) : base(amdDevice.DeviceID, amdDevice.DeviceName, true, DeviceGroupType.AMD_OpenCL, amdDevice.IsEtherumCapable(), DeviceType.AMD, String.Format(International.GetText("ComputeDevice_Short_Name_AMD_GPU"), GPUCount), amdDevice.DeviceGlobalMemory) { if (isDetectionFallback) { UUID = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType); } else { UUID = amdDevice.UUID; } BusID = amdDevice.BusID; Codename = amdDevice.Codename; InfSection = amdDevice.InfSection; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); DriverDisableAlgos = amdDevice.DriverDisableAlgos; Index = ID + ComputeDeviceManager.Avaliable.AvailCPUs + ComputeDeviceManager.Avaliable.AvailNVGPUs; adapterIndex = amdDevice.AdapterIndex; }
// GPU AMD public ComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallback) { ID = amdDevice.DeviceID; DeviceGroupType = DeviceGroupType.AMD_OpenCL; Name = amdDevice.DeviceName; Enabled = true; IsEtherumCapale = amdDevice.IsEtherumCapable(); DeviceType = DeviceType.AMD; NameCount = String.Format(International.GetText("ComputeDevice_Short_Name_AMD_GPU"), GPUCount); if (isDetectionFallback) { UUID = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType); } else { UUID = amdDevice.UUID; } // sgminer extra //IsOptimizedVersion = amdDevice.UseOptimizedVersion; Codename = amdDevice.Codename; InfSection = amdDevice.InfSection; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); DriverDisableAlgos = amdDevice.DriverDisableAlgos; GpuRam = amdDevice.DeviceGlobalMemory; }
// GPU NVIDIA public ComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int GPUCount) { ID = (int)cudaDevice.DeviceID; Name = cudaDevice.GetName(); Enabled = true; DeviceGroupType = group; IsEtherumCapale = cudaDevice.IsEtherumCapable(); DeviceType = DeviceType.NVIDIA; NameCount = String.Format(International.GetText("ComputeDevice_Short_Name_NVIDIA_GPU"), GPUCount); UUID = cudaDevice.UUID; AlgorithmSettings = GroupAlgorithms.CreateForDevice(this); }
// CPU public ComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int CPUCount) { ID = id; Name = name; Threads = threads; AffinityMask = affinityMask; Enabled = true; DeviceGroupType = DeviceGroupType.CPU; DeviceType = DeviceType.CPU; NameCount = String.Format(International.GetText("ComputeDevice_Short_Name_CPU"), CPUCount); UUID = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType); AlgorithmSettings = GroupAlgorithms.CreateForDevice(this); IsEtherumCapale = false; }
public ComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int gpuCount) { SMMajor = cudaDevice.SM_major; SMMinor = cudaDevice.SM_minor; ID = (int)cudaDevice.DeviceID; Name = cudaDevice.GetName(); Enabled = true; DeviceGroupType = group; IsEtherumCapale = cudaDevice.IsEtherumCapable(); DeviceType = DeviceType.NVIDIA; NameCount = string.Format(International.GetText("ComputeDevice_Short_Name_NVIDIA_GPU"), gpuCount); Uuid = cudaDevice.UUID; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); GpuRam = cudaDevice.DeviceGlobalMemory; }
// GPU AMD public ComputeDevice(AmdGpuDevice amdDevice, int GPUCount) { ID = amdDevice.DeviceID; DeviceGroupType = DeviceGroupType.AMD_OpenCL; Name = amdDevice.DeviceName; Enabled = true; IsEtherumCapale = amdDevice.IsEtherumCapable(); DeviceType = DeviceType.AMD; NameCount = String.Format(International.GetText("ComputeDevice_Short_Name_AMD_GPU"), GPUCount); UUID = amdDevice.UUID; // sgminer extra IsOptimizedVersion = amdDevice.UseOptimizedVersion; Codename = amdDevice.Codename; AlgorithmSettings = GroupAlgorithms.CreateForDevice(this); }
public void SetAlgorithmDeviceConfig(DeviceBenchmarkConfig config) { if (config != null && config.DeviceUUID == UUID && config.AlgorithmSettings != null) { this.AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); foreach (var conf in config.AlgorithmSettings) { var setAlgo = GetAlgorithm(conf.MinerBaseType, conf.NiceHashID); if (setAlgo != null) { setAlgo.BenchmarkSpeed = conf.BenchmarkSpeed; setAlgo.ExtraLaunchParameters = conf.ExtraLaunchParameters; setAlgo.Enabled = conf.Enabled; setAlgo.LessThreads = conf.LessThreads; } } } }
public CudaComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int GPUCount, NvPhysicalGpuHandle nvHandle) : base((int)cudaDevice.DeviceID, cudaDevice.GetName(), true, group, cudaDevice.IsEtherumCapable(), DeviceType.NVIDIA, String.Format(International.GetText("ComputeDevice_Short_Name_NVIDIA_GPU"), GPUCount), cudaDevice.DeviceGlobalMemory) { _SM_major = cudaDevice.SM_major; _SM_minor = cudaDevice.SM_minor; UUID = cudaDevice.UUID; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); Index = ID + ComputeDeviceManager.Avaliable.AvailCPUs; // increment by CPU count this.nvHandle = nvHandle; }
public CPUComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int CPUCount) : base(id, name, true, DeviceGroupType.CPU, false, DeviceType.CPU, String.Format(International.GetText("ComputeDevice_Short_Name_CPU"), CPUCount), 0) { Threads = threads; AffinityMask = affinityMask; UUID = GetUUID(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType); AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); Index = ID; // Don't increment for CPU cpuCounter = new PerformanceCounter(); cpuCounter.CategoryName = "Processor"; cpuCounter.CounterName = "% Processor Time"; cpuCounter.InstanceName = "_Total"; }
public CudaComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int gpuCount, NvPhysicalGpuHandle nvHandle, nvmlDevice nvmlHandle) : base((int)cudaDevice.DeviceID, cudaDevice.GetName(), true, group, cudaDevice.IsEtherumCapable(), DeviceType.NVIDIA, string.Format(Translations.Tr("GPU#{0}"), gpuCount), cudaDevice.DeviceGlobalMemory) { BusID = cudaDevice.pciBusID; SMMajor = cudaDevice.SM_major; SMMinor = cudaDevice.SM_minor; Uuid = cudaDevice.UUID; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); Index = ID + AvailableDevices.AvailCpus; // increment by CPU count _nvHandle = nvHandle; _nvmlDevice = nvmlHandle; ShouldRunEthlargement = cudaDevice.DeviceName.Contains("1080") || cudaDevice.DeviceName.Contains("Titan Xp"); }
public CpuComputeDevice(int id, string group, string name, int threads, ulong affinityMask, int cpuCount) : base(id, name, true, DeviceGroupType.CPU, false, DeviceType.CPU, string.Format(Translations.Tr("CPU#{0}"), cpuCount), 0) { Threads = threads; AffinityMask = affinityMask; Uuid = GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType); AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); Index = ID; // Don't increment for CPU _cpuCounter = new PerformanceCounter { CategoryName = "Processor", CounterName = "% Processor Time", InstanceName = "_Total" }; }
public void SetAlgorithmDeviceConfig(DeviceBenchmarkConfig config) { if (config != null && config.DeviceUUID == Uuid && config.AlgorithmSettings != null) { AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); foreach (var conf in config.AlgorithmSettings) { var setAlgo = GetAlgorithm(conf.MinerBaseType, conf.NiceHashID, conf.SecondaryNiceHashID); if (setAlgo != null) { setAlgo.BenchmarkSpeed = conf.BenchmarkSpeed; setAlgo.ExtraLaunchParameters = conf.ExtraLaunchParameters; setAlgo.Enabled = conf.Enabled; setAlgo.LessThreads = conf.LessThreads; setAlgo.PowerUsage = conf.PowerUsage; if (setAlgo is DualAlgorithm dualSA) { dualSA.SecondaryBenchmarkSpeed = conf.SecondaryBenchmarkSpeed; var dualConf = config.DualAlgorithmSettings?.Find(a => a.SecondaryNiceHashID == dualSA.SecondaryNiceHashID); if (dualConf != null) { dualConf.FixSettingsBounds(); dualSA.IntensitySpeeds = dualConf.IntensitySpeeds; dualSA.SecondaryIntensitySpeeds = dualConf.SecondaryIntensitySpeeds; dualSA.TuningEnabled = dualConf.TuningEnabled; dualSA.TuningStart = dualConf.TuningStart; dualSA.TuningEnd = dualConf.TuningEnd; dualSA.TuningInterval = dualConf.TuningInterval; dualSA.IntensityPowers = dualConf.IntensityPowers; dualSA.UseIntensityPowers = dualConf.UseIntensityPowers; } } } } } }
public AmdComputeDevice(AmdGpuDevice amdDevice, int gpuCount, bool isDetectionFallback, int adl2Index) : base(amdDevice.DeviceID, amdDevice.DeviceName, true, DeviceGroupType.AMD_OpenCL, amdDevice.IsEtherumCapable(), DeviceType.AMD, string.Format(Translations.Tr("GPU#{0}"), gpuCount), amdDevice.DeviceGlobalMemory) { Uuid = isDetectionFallback ? GetUuid(ID, GroupNames.GetGroupName(DeviceGroupType, ID), Name, DeviceGroupType) : amdDevice.UUID; BusID = amdDevice.BusID; Codename = amdDevice.Codename; InfSection = amdDevice.InfSection; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); DriverDisableAlgos = amdDevice.DriverDisableAlgos; Index = ID + ComputeDeviceManager.Available.AvailCpus + ComputeDeviceManager.Available.AvailNVGpus; _adapterIndex = amdDevice.AdapterIndex; ADL.ADL2_Main_Control_Create?.Invoke(ADL.ADL_Main_Memory_Alloc, 0, ref _adlContext); _adapterIndex2 = adl2Index; }