Hardware/Nvidia/NvidiaGPU.cs
changeset 166 fa9dfbfc4145
parent 165 813d8bc3192f
child 167 b7cc9d09aefe
     1.1 --- a/Hardware/Nvidia/NvidiaGPU.cs	Sun Aug 08 13:57:26 2010 +0000
     1.2 +++ b/Hardware/Nvidia/NvidiaGPU.cs	Thu Aug 12 20:53:27 2010 +0000
     1.3 @@ -37,6 +37,7 @@
     1.4  
     1.5  using System;
     1.6  using System.Collections.Generic;
     1.7 +using System.Globalization;
     1.8  using System.Text;
     1.9  
    1.10  namespace OpenHardwareMonitor.Hardware.Nvidia {
    1.11 @@ -115,7 +116,10 @@
    1.12      }
    1.13  
    1.14      public override Identifier Identifier {
    1.15 -      get { return new Identifier("nvidiagpu", adapterIndex.ToString()); }
    1.16 +      get { 
    1.17 +        return new Identifier("nvidiagpu", 
    1.18 +          adapterIndex.ToString(CultureInfo.InvariantCulture)); 
    1.19 +      }
    1.20      }
    1.21  
    1.22      public override HardwareType HardwareType {
    1.23 @@ -136,12 +140,12 @@
    1.24      }
    1.25  
    1.26      private uint[] GetClocks() {
    1.27 -      NvClocks clocks = new NvClocks();
    1.28 -      clocks.Version = NVAPI.GPU_CLOCKS_VER;
    1.29 -      clocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
    1.30 +      NvClocks allClocks = new NvClocks();
    1.31 +      allClocks.Version = NVAPI.GPU_CLOCKS_VER;
    1.32 +      allClocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
    1.33        if (NVAPI.NvAPI_GPU_GetAllClocks != null &&
    1.34 -        NVAPI.NvAPI_GPU_GetAllClocks(handle, ref clocks) == NvStatus.OK) {
    1.35 -        return clocks.Clock;
    1.36 +        NVAPI.NvAPI_GPU_GetAllClocks(handle, ref allClocks) == NvStatus.OK) {
    1.37 +        return allClocks.Clock;
    1.38        }
    1.39        return null;
    1.40      }
    1.41 @@ -235,7 +239,7 @@
    1.42            r.Append("Driver Version: ");
    1.43            r.Append(driverVersion.DriverVersion / 100);
    1.44            r.Append(".");
    1.45 -          r.Append((driverVersion.DriverVersion % 100).ToString("00"));
    1.46 +          r.Append((driverVersion.DriverVersion % 100).ToString("00", CultureInfo.InvariantCulture));
    1.47            r.AppendLine();
    1.48            r.Append("Driver Branch: ");
    1.49            r.AppendLine(driverVersion.BuildBranch);
    1.50 @@ -275,17 +279,17 @@
    1.51        }      
    1.52  
    1.53        if (NVAPI.NvAPI_GPU_GetAllClocks != null) {
    1.54 -        NvClocks clocks = new NvClocks();
    1.55 -        clocks.Version = NVAPI.GPU_CLOCKS_VER;
    1.56 -        clocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
    1.57 -        NvStatus status = NVAPI.NvAPI_GPU_GetAllClocks(handle, ref clocks);
    1.58 +        NvClocks allClocks = new NvClocks();
    1.59 +        allClocks.Version = NVAPI.GPU_CLOCKS_VER;
    1.60 +        allClocks.Clock = new uint[NVAPI.MAX_CLOCKS_PER_GPU];
    1.61 +        NvStatus status = NVAPI.NvAPI_GPU_GetAllClocks(handle, ref allClocks);
    1.62  
    1.63          r.AppendLine("Clocks");
    1.64          r.AppendLine();
    1.65          if (status == NvStatus.OK) {
    1.66 -          for (int i = 0; i < clocks.Clock.Length; i++)
    1.67 -            if (clocks.Clock[i] > 0) {
    1.68 -              r.AppendFormat(" Clock[{0}]: {1}{2}", i, clocks.Clock[i],
    1.69 +          for (int i = 0; i < allClocks.Clock.Length; i++)
    1.70 +            if (allClocks.Clock[i] > 0) {
    1.71 +              r.AppendFormat(" Clock[{0}]: {1}{2}", i, allClocks.Clock[i],
    1.72                  Environment.NewLine);
    1.73              }
    1.74          } else {