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 /// <summary> /// Initializes a new instance of the <see cref="ComputeDevice"/> class. /// </summary> /// <param name="amdDevice">The <see cref="AmdGpuDevice"/></param> /// <param name="GPUCount">The <see cref="int"/></param> /// <param name="isDetectionFallback">The <see cref="bool"/></param> public ComputeDevice(AmdGpuDevice amdDevice, int GPUCount, bool isDetectionFallback) { ID = amdDevice.DeviceID; BusID = amdDevice.BusID; 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; }
/// <summary> /// Initializes a new instance of the <see cref="ComputeDevice"/> class. /// </summary> /// <param name="cudaDevice">The <see cref="CudaDevice"/></param> /// <param name="group">The <see cref="DeviceGroupType"/></param> /// <param name="GPUCount">The <see cref="int"/></param> public ComputeDevice(CudaDevice cudaDevice, DeviceGroupType group, int GPUCount) { _SM_major = cudaDevice.SM_major; _SM_minor = 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; }
// CPU /// <summary> /// Initializes a new instance of the <see cref="ComputeDevice"/> class. /// </summary> /// <param name="id">The <see cref="int"/></param> /// <param name="group">The <see cref="string"/></param> /// <param name="name">The <see cref="string"/></param> /// <param name="threads">The <see cref="int"/></param> /// <param name="affinityMask">The <see cref="ulong"/></param> /// <param name="CPUCount">The <see cref="int"/></param> 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.CreateForDeviceList(this); IsEtherumCapale = false; GpuRam = 0; }
/// <summary> /// The SetAlgorithmDeviceConfig /// </summary> /// <param name="config">The <see cref="DeviceBenchmarkConfig"/></param> 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.CryptoMiner937ID, conf.SecondaryCryptoMiner937ID); if (setAlgo != null) { setAlgo.BenchmarkSpeed = conf.BenchmarkSpeed; setAlgo.SecondaryBenchmarkSpeed = conf.SecondaryBenchmarkSpeed; 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) { BusID = cudaDevice.pciBusID; _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(International.GetText("ComputeDevice_Short_Name_NVIDIA_GPU"), gpuCount), cudaDevice.DeviceGlobalMemory) { BusID = cudaDevice.pciBusID; SMMajor = cudaDevice.SM_major; SMMinor = cudaDevice.SM_minor; UUID = cudaDevice.UUID; AlgorithmSettings = GroupAlgorithms.CreateForDeviceList(this); Index = ID + ComputeDeviceManager.Avaliable.AvailCPUs; // increment by CPU count _nvHandle = nvHandle; nvmlDevice = nvmlHandle; ShouldRunEthlargement = cudaDevice.DeviceName.Contains("1080") || cudaDevice.DeviceName.Contains("Titan Xp"); }