All Projects → foucault → Nvfancontrol

foucault / Nvfancontrol

Licence: gpl-3.0
NVidia dynamic fan control for Linux and Windows

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Nvfancontrol

Pyopencl
OpenCL integration for Python, plus shiny features
Stars: ✭ 790 (+749.46%)
Mutual labels:  nvidia, gpu
Cuda
Experiments with CUDA and Rust
Stars: ✭ 31 (-66.67%)
Mutual labels:  nvidia, gpu
Jetsonjs
Embed a JavaScript/WebGL application on a Nvidia Jetson TX2 and stream the results through websockets. It does not rely on CUDA/Jetpack. HDMI touchscreen, virtual keyboard, GPIO control, wifi config are included.
Stars: ✭ 18 (-80.65%)
Mutual labels:  nvidia, gpu
Cudasift
A CUDA implementation of SIFT for NVidia GPUs (1.2 ms on a GTX 1060)
Stars: ✭ 555 (+496.77%)
Mutual labels:  nvidia, gpu
Optix Path Tracer
OptiX Path Tracer
Stars: ✭ 60 (-35.48%)
Mutual labels:  nvidia, gpu
Coriander
Build NVIDIA® CUDA™ code for OpenCL™ 1.2 devices
Stars: ✭ 665 (+615.05%)
Mutual labels:  nvidia, gpu
Waifu2x Ncnn Vulkan
waifu2x converter ncnn version, runs fast on intel / amd / nvidia GPU with vulkan
Stars: ✭ 1,258 (+1252.69%)
Mutual labels:  nvidia, gpu
Nvptx
How to: Run Rust code on your NVIDIA GPU
Stars: ✭ 335 (+260.22%)
Mutual labels:  nvidia, gpu
Hidden Miner Builder
Hidden miner builder
Stars: ✭ 58 (-37.63%)
Mutual labels:  nvidia, gpu
Multiple Smi
Python bindings for pyNVML and psutil library over network
Stars: ✭ 49 (-47.31%)
Mutual labels:  nvidia, gpu
Ilgpu
ILGPU JIT Compiler for high-performance .Net GPU programs
Stars: ✭ 374 (+302.15%)
Mutual labels:  nvidia, gpu
Deep Learning Boot Camp
A community run, 5-day PyTorch Deep Learning Bootcamp
Stars: ✭ 1,270 (+1265.59%)
Mutual labels:  nvidia, gpu
Cuda Api Wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
Stars: ✭ 362 (+289.25%)
Mutual labels:  nvidia, gpu
Tf Coriander
OpenCL 1.2 implementation for Tensorflow
Stars: ✭ 775 (+733.33%)
Mutual labels:  nvidia, gpu
Realsr Ncnn Vulkan
RealSR super resolution implemented with ncnn library
Stars: ✭ 357 (+283.87%)
Mutual labels:  nvidia, gpu
Cub
Cooperative primitives for CUDA C++.
Stars: ✭ 883 (+849.46%)
Mutual labels:  nvidia, gpu
Nvtop
NVIDIA GPUs htop like monitoring tool
Stars: ✭ 3,604 (+3775.27%)
Mutual labels:  nvidia, gpu
Thrust
The C++ parallel algorithms library.
Stars: ✭ 3,595 (+3765.59%)
Mutual labels:  nvidia, gpu
Gpudashboard
A simple dashboard for NVIDIA GPU
Stars: ✭ 37 (-60.22%)
Mutual labels:  nvidia, gpu
Parenchyma
An extensible HPC framework for CUDA, OpenCL and native CPU.
Stars: ✭ 71 (-23.66%)
Mutual labels:  nvidia, gpu

nvfancontrol

About

Nvfancontrol provides dynamic fan control for NVidia graphic cards on Linux and Windows.

Sometimes it is desirable to control the fan speed of the graphics card using a custom response curve instead of the automatic setting that is built into the card's BIOS. Especially in newer GPUs the fan does not kick in below 60°C or a certain level of GPU utilization. This is a small toy project in Rust to achieve a more elaborate control over this using either XNVCtrl in Linux or NVAPI in Windows. It is a work in progress so proceed with caution!

The minimum supported driver version is 352.09. For GPUs with multiple independent cooler control nvfancontrol will autodetect and apply the provided response curve to each of the available fans separately.

HowTo

Building

Pre-built binaries for the latest release are provided however if you want to build the project from source read along.

Prerequisites for Linux

You will need:

  • the Rust compiler toolchain, stable >=1.34 or nightly (build)
  • XNVCtrl; static (build only) or dynamic (build and runtime)
  • Xlib (build and runtime)
  • Xext (build and runtime)

Since XNVCtrl supports FreeBSD in addition to Linux these instructions should also work for FreeBSD without further modifications. However nvfancontrol is completely untested on FreeBSD (bug reports are welcome).

Prerequisites for Windows

You will need:

  • the Rust compiler toolchain, stable >=1.15 or nightly. Be adviced that you need the MSVC ABI version of the toolchain not GNU. In order to target the MSVC ABI for Rust you will also need the Visual C++ build tools package or any recent version of Visual Studio (2015+). If you are using rustup (which you should) you will be warned about this (build only)
  • the NVAPI libraries (build only). Depending on which version you are building (x86, x64 or both) place nvapi.lib, nvapi64.lib or both in the root of the repository. As nvapi is linked statically there are no runtime dependencies apart from the NVidia driver.

For both platforms run cargo build --release. Upon successful compilation the executable can be found in target/release/nvfancontrol. On Linux the build tool expects the libraries installed in /usr/lib or /usr/local/lib. In case you have libraries installed in different locations export them using the LIBRARY_PATH environment variable (colon separated paths). By default libXNVCtrl will be linked statically. If a static version of libXNVCtrl is not available or you explicitly want it to be linked dynamically add --features=dynamic-xnvctrl to the cargo incantation.

Enable Coolbits (Linux only)

For Linux ensure that Coolbits is enabled from your X11 server settings. To do so create a file named 20-nvidia.conf within /etc/X11/xorg.conf.d/ or /usr/share/X11/xorg.conf.d/ (depends on distribution) containing the following

Section "Device"
    Identifier "Device 0"
    Driver     "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName  "IDENTIFIER FOR YOUR GPU"
    Option     "Coolbits" "4"
EndSection

The important bit is the Coolbits option. Valid Coolbits values for dynamic fan control are 4, 5 and 12. A sample configuration file is provided.

Use and configure

To run the program just execute the nvfancontrol binary. Add the -d or --debug argument for more output. To add a custom curve you can provide a custom configuration file. On Linux create a file named nvfancontrol.conf under the XDG configuration directory (~/.config or /etc/xdg for per-user and system-wide basis respectively). On Windows create the file in C:\Users\[USERNAME]\AppData\Roaming instead. The configuration file should contain pairs of whitespace delimited parameters (Temperature degrees Celsius, Fan Speed %). For example

30    20
40    30
50    40
60    50
70    60
80    80

Lines starting with # are ignored. You need at least two pairs of values.

Bear in mind that for most GPUs the fan speed can't be below 20% or above 80% when in manual control, even if you use greater values. However, since these limits are arbitrary and vary among different VGA BIOS you can override it using the -l, or --limits option. For example to change the limits to 10% and 90% pass -l 10,90. To disable the limits effectively enabling the whole range just pass -l 0. In addition note that the program by default will not use the custom curve if the fan is already spinning in automatic control. This is the most conservative configuration for GPUs that turn their fans off below a certain temperature threshold. If you want to always use the custom curve pass the additional -f or --force argument. To terminate nvfancontrol send a SIGINT or SIGTERM on Linux or hit Ctrl-C in the console window on Windows.

Although presently nvfancontrol is limited to a single GPU, users can select the card to modulate the fan operation using the -g or --gpu switch. GPUs are indexed from 0. To help with that option -p or --print-coolers will list all available GPUs with their respective coolers. On Windows coolers are indexed from 0 for each GPU. On Linux each available cooler on the system is assigned a unique id.

Third party interfacing

nvfancontrol offers two ways to dump the output of the program for integration with third party programs. Using the -j option a JSON represantation of the current data is printed to stdout. As all other messages are printed to stderr the data can be parsed by reading new-line delimited data from the program's stdout. If this is not desirable a builtin TCP server is also provided which can be enabled using the -t option. This option can optionally be followed by a port number (default port is 12125). The server prints the JSON data through the socket and immediately closes the connection. The message is always terminated with a new-line character.

Fan flicker prevention

Due to firmware issues in several RTX series GPUs fans will tend to rapidly turn on and off at low speeds (fan flickering). To counter this nvfancontrol includes a workaround which is accessible using the -r or --fanflicker switch (config. option fanflicker = [min, max]). Fan flicker prevention will attempt to gradually lower or increase the fan speed within a user-specified range (the flickering zone). When the fan speed drops below the min flickering prevention will kick in. As an example for min = 11 and max = 38 curve changes are applied gradually. Above 38% behaviour is normal and arbitrary jumps are again allowed.

Bugs and known issues

Although nvfancontrol should work with most Fermi or newer NVidia cards it has been tested with only a handful of GPUs. So it is quite possible that bugs or unexpected behaviour might surface. In that case please open an issue in the bug tracker including the complete program output (use the --debug option).

RPM reporting for GPUs with multiple fans on Windows is incorrect or totally wrong because the provided function NvAPI_GPU_GetTachReading is limited to a single fan. There is nothing in the public NVAPI to suggest otherwise. However, speed in % should work as expected. In any case multiple cooler support on Windows is not thoroughly tested so bug reports are always welcome!

As mentioned before, nvfancontrol is limited to a single (but selectable) GPU. The underlying code does support multiple GPUs but exposing this support to the user-facing program will require possibly breaking alterations to the configuration file. It will be added eventually.

License

This project is licensed under the GPLv3 or any newer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].