Git Product home page Git Product logo

Comments (7)

MaynardMiner avatar MaynardMiner commented on May 27, 2024 1

@adolfomantis

https://github.com/MaynardMiner/SWARM/tree/master/build/apps/nvfans

try using this application, and let me know if it works. I have not had a user inform me that it is not working yet.

nvfans.exe -i [GPU_INDEX_NUMBER] -s [SPEED IN PERCENT]

code:

using System;
using System.Linq;
using ConsoleUtilities;
using NvAPIWrapper;
using NvAPIWrapper.GPU;
using CommandLine;

namespace nvfans
{
	class Program
	{
		public class Options
		{
			[Option('i', "index", Required = false, HelpText = "Target GPU.")]
			public int Index { get; set; }
			[Option('s', "speed", Required = false, HelpText = "Desired Command Speed.")]
			public int Speed { get; set; }
		}

		static void Main(string[] args)
		{
			int Index = -1;
			int Speed = -1;

			CommandLine.Parser.Default.ParseArguments<Options>(args)
			.WithParsed<Options>(o =>
			 {
				 if (o.Index > -1) { Index = o.Index; }
				 else {
					 Console.WriteLine("Argument Index invalid");
					 System.Environment.Exit(0);
				 }
				 if (o.Speed > -1 )
				 {
					 if(o.Speed < 101) { Speed = o.Speed; }
					 else
					 {
						 Console.WriteLine("Argument Speed invalid");
						 System.Environment.Exit(0);
					 }
				 }
			 });

			NVIDIA.Initialize();
			var GPUs = PhysicalGPU.GetPhysicalGPUs();
			var Cool = GPUs[Index].CoolerInformation.Coolers;
			var k = Cool.ToArray();
			for (int j = 0; j < k.Count(); j++)
			{
				GPUs[0].CoolerInformation.SetCoolerSettings(j, Speed);
				int test = GPUs[0].CoolerInformation.CurrentFanSpeedLevel;
				Console.WriteLine($"Current Fan speed: {test}");
				Console.WriteLine($"New Fan Speed: {Speed}");
			}
			Console.ReadKey();
		}

	}
}

https://github.com/commandlineparser/commandline [for CommandLine]

from nvapiwrapper.

falahati avatar falahati commented on May 27, 2024

Issue #10 might be interesting to you.

Update to the latest version of library and try the high-level API as follow:

    var GPUs = PhysicalGPU.GetPhysicalGPUs();
    var Cool = GPUs[Index].CoolerInformation.Coolers;
    for (int j = 0; j < Cool.Count(); j++)
    {
        var speed = Cool[j].CurrentLevel;
        Console.WriteLine(speed);
    }

If this failed to work for you please notify me.

from nvapiwrapper.

falahati avatar falahati commented on May 27, 2024

If you insist on using the low-level API, following is the list of methods that can help you with RTX cards:

GPUApi.GetClientFanCoolersInfo();
GPUApi.GetClientFanCoolersStatus();
GPUApi.GetClientFanCoolersControl();

from nvapiwrapper.

adolfomantis avatar adolfomantis commented on May 27, 2024

Thanks for your soon response. Yes, problem occurs in low-level API call. In GPUApi.GetClientFanCoolersInfo() function works very fine, NvAPI_Status = 0 and returns correct data (2 Coolers for count and Max RPM for each cooler), but when i try to use GPUApi.GetClientFanCoolersStatus() or GPUApi.GetClientFanCoolersControl() both funtions return error (NvAPI_status = -5 (NVAPI_INVALID_ARGUMENT)). I suspect nvapi changed data structures (to a new version o V2) in last drivers. I will try to find Nvidia Driver 410, Release, install it and i will try again. I will keep inform you. Thanks

from nvapiwrapper.

adolfomantis avatar adolfomantis commented on May 27, 2024

Problem persist with 425.11 driver version....

from nvapiwrapper.

falahati avatar falahati commented on May 27, 2024

I suspect nvapi changed data structures (to a new version o V2) in last drivers.

If that's the case it means that old overclocking programs (like an older version of afterburner) would not work. If they decide to add new functionality they usually add a new structure with a new version which is then selected and acted upon when calling the API. Breaking all old programs is a bad move and I don't think they did that.

Invalid argument error is interesting. It might be that we missed something with the PrivateFanCoolersStatusV1 and PrivateFanCoolersControlV1 structures. And to be honest there is not much there to go wrong. Maybe one of the _Reserved fields or the _UnknownUInt field supposed to have some information we are missing. But the size of struct and the version should be correct as there is no STRUCT error. Please try changing the setting of the fans using a third-party application like the afterburner and see if in a specific configuration this library works as expected. (locked mode; unlocked, etc)

Also, the MaynardMiner's app might be a good example of how you should get this information and change them. If it fails for you as well but every third party overclocking program works as expected, then there is something wrong with the implementation of the structures in the library and I can hopefully take a look at this with your help since I don't have access to any RTX card at the moment or even near future. They are expensive here and I am not really a gamer, ... anymore :)

from nvapiwrapper.

falahati avatar falahati commented on May 27, 2024

Closed due to inactivity

from nvapiwrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.