Added NVAPI report output.
This commit is contained in:
@@ -37,16 +37,22 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
|
||||
public class NvidiaGroup : IGroup {
|
||||
|
||||
private List<IHardware> hardware = new List<IHardware>();
|
||||
private StringBuilder report = new StringBuilder();
|
||||
|
||||
public NvidiaGroup() {
|
||||
if (!NVAPI.IsAvailable)
|
||||
return;
|
||||
|
||||
report.AppendLine("NVAPI");
|
||||
report.AppendLine();
|
||||
|
||||
NvPhysicalGpuHandle[] handles =
|
||||
new NvPhysicalGpuHandle[NVAPI.MAX_PHYSICAL_GPUS];
|
||||
|
||||
@@ -54,6 +60,10 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
if (NVAPI.NvAPI_EnumPhysicalGPUs(handles, out count) != NvStatus.OK)
|
||||
return;
|
||||
|
||||
report.Append("Number of GPUs: ");
|
||||
report.AppendLine(count.ToString());
|
||||
report.AppendLine();
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
string gpuName;
|
||||
NVAPI.NvAPI_GPU_GetFullName(handles[i], out gpuName);
|
||||
@@ -69,7 +79,7 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
||||
}
|
||||
|
||||
public string GetReport() {
|
||||
return null;
|
||||
return report.ToString();
|
||||
}
|
||||
|
||||
public void Close() {
|
||||
|
||||
Reference in New Issue
Block a user