foucault / nvfancontrol

NVidia dynamic fan control for Linux and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on Windows 10 with 2070 Super

Gordin opened this issue · comments

I get this Error when trying to use nvfancontrol. I tried the release version and also compiled it myself. Same result.
From the other bug report it looks like nvfancontrol just does not work on RTX cards because NvAPI does not work with RTX cards yet?

.\nvfancontrol.exe -d
WARN - No config file found; using default curve
DEBUG - Default configuration loaded
DEBUG - [[gpu]]
id = 0
enabled = true
points = [[41, 20], [49, 30], [57, 45], [66, 55], [75, 63], [78, 72], [80, 80]]
DEBUG - Curve points: [(41, 20), (49, 30), (57, 45), (66, 55), (75, 63), (78, 72), (80, 80)]
INFO - NVIDIA driver version: 450.12
INFO - NVIDIA graphics adapter #0: GeForce RTX 2070 SUPER
WARN - Could not get GPU cooler indices or unsupported OS
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "NvAPI_GPU_GetCoolerSettings() failed; error -104"', src\main.rs:705:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
DEBUG - Resetting fan control
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "NvAPI_GPU_GetCoolerSettings() failed; error -104"', src\main.rs:82:9
stack backtrace:
   0:     0x7ff7249deb6f - backtrace::backtrace::trace_unsynchronized
                               at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.44\src\backtrace\mod.rs:66
   1:     0x7ff7249deb6f - std::sys_common::backtrace::_print_fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:78
   2:     0x7ff7249deb6f - std::sys_common::backtrace::_print::{{impl}}::fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:59
   3:     0x7ff7249f505b - core::fmt::write
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\fmt\mod.rs:1063
   4:     0x7ff7249d7d6c - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\io\mod.rs:1426
   5:     0x7ff7249e1dfc - std::sys_common::backtrace::_print
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:62
   6:     0x7ff7249e1dfc - std::sys_common::backtrace::print
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:49
   7:     0x7ff7249e1dfc - std::panicking::default_hook::{{closure}}
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:204
   8:     0x7ff7249e1a4f - std::panicking::default_hook
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:224
   9:     0x7ff7249e25d7 - std::panicking::rust_panic_with_hook
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:470
  10:     0x7ff7249e215f - std::panicking::begin_panic_handler
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:378
  11:     0x7ff7249f2fc0 - core::panicking::panic_fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\panicking.rs:85
  12:     0x7ff7249f2df3 - core::option::expect_none_failed
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\option.rs:1211
  13:     0x7ff7249959e0 - <&mut toml::de::Deserializer as serde::de::Deserializer>::deserialize_struct::he6b7ea5729fafcaf
  14:     0x7ff7249a0f32 - nvfancontrol::validate_gpu_id::h65825082353cce93
  15:     0x7ffabfda1030 - <unknown>
  16:     0x7ffabfda4a2b - is_exception_typeof
  17:     0x7ffabfdae3d4 - _C_specific_handler
  18:     0x7ffabfda3cb0 - is_exception_typeof
  19:     0x7ffabfdaed01 - _CxxFrameHandler3
  20:     0x7ffad3d5016f - _chkstk
  21:     0x7ffad3cd1c56 - RtlUnwindEx
  22:     0x7ffabfdae892 - _C_specific_handler
  23:     0x7ffabfda2941 - is_exception_typeof
  24:     0x7ffabfda2d6d - is_exception_typeof
  25:     0x7ffabfda3dac - is_exception_typeof
  26:     0x7ffabfdaed01 - _CxxFrameHandler3
  27:     0x7ffad3d500ef - _chkstk
  28:     0x7ffad3cfb474 - RtlRaiseException
  29:     0x7ffad3cfb1c5 - RtlRaiseException
  30:     0x7ffad1843e49 - RaiseException
  31:     0x7ffabfda61e0 - CxxThrowException
  32:     0x7ff7249e5e51 - panic_unwind::imp::panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libpanic_unwind\seh.rs:308
  33:     0x7ff7249e5dd9 - panic_unwind::__rust_start_panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libpanic_unwind\lib.rs:111
  34:     0x7ff7249e26b8 - std::panicking::rust_panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:522
  35:     0x7ff7249e2691 - std::panicking::rust_panic_with_hook
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:492
  36:     0x7ff7249e215f - std::panicking::begin_panic_handler
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:378
  37:     0x7ff7249f2fc0 - core::panicking::panic_fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\panicking.rs:85
  38:     0x7ff7249f2df3 - core::option::expect_none_failed
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\option.rs:1211
  39:     0x7ff72499cdec - nvfancontrol::validate_gpu_id::h65825082353cce93
  40:     0x7ff7249a3f86 - serde::ser::SerializeMap::serialize_entry::hac995fd7f3fa2505
  41:     0x7ff7249e1ff7 - std::rt::lang_start_internal::{{closure}}
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\rt.rs:52
  42:     0x7ff7249e1ff7 - std::panicking::try::do_call<closure-0,i32>
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:303
  43:     0x7ff7249e5d52 - panic_unwind::__rust_maybe_catch_panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libpanic_unwind\lib.rs:86
  44:     0x7ff7249e2818 - std::panicking::try
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:281
  45:     0x7ff7249e2818 - std::panic::catch_unwind
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panic.rs:394
  46:     0x7ff7249e2818 - std::rt::lang_start_internal
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\rt.rs:51
  47:     0x7ff7249a1457 - main
  48:     0x7ff7249ff164 - invoke_main
                               at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  49:     0x7ff7249ff164 - __scrt_common_main_seh
                               at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  50:     0x7ffad37c6fd4 - BaseThreadInitThunk
  51:     0x7ffad3cfcec1 - RtlUserThreadStart
thread panicked while panicking. aborting.

Hello! Thanks for your bug report. This is indeed most probably related to #12 and the missing NvAPI functions. Error 104 is literally NVAPI_NOT_SUPPORTED: Requested feature is not supported in the selected GPU (god I really hate NvAPI). Still it should have progressed slightly further than the cooler indices. Not sure if we can make it work with the undocumented API but maybe we can get some more information out of it. Does the card have one or two fans and do they work independently (ie. can the RPMs be tuned per fan)? I know I may be asking too much but does it work with earlier versions of the NVIDIA driver? There is a non-insignificant possibility that something broke between driver updates.

The card has 3 fans, it's this one: https://www.gigabyte.com/de/Graphics-Card/GV-N207SGAMING-OC-8GC#kf

I think you can only control all 3 at the same time, but I don't know how I would check that. All overclocking tools on Windows at least give me only one fan value to change and only show one rpm counter.

I can check a couple different driver versions, I don't know which driver versions are even worth checking though.

This is with 431.36, same result I think. 419 is too old to install. I'll try some 42X versions, I guess it will be the same.

WARN - No config file found; using default curve
DEBUG - Default configuration loaded
DEBUG - [[gpu]]
id = 0
enabled = true
points = [[41, 20], [49, 30], [57, 45], [66, 55], [75, 63], [78, 72], [80, 80]]
DEBUG - Curve points: [(41, 20), (49, 30), (57, 45), (66, 55), (75, 63), (78, 72), (80, 80)]
INFO - NVIDIA driver version: 431.36
INFO - NVIDIA graphics adapter #0: GeForce RTX 2070 SUPER
WARN - Could not get GPU cooler indices or unsupported OS
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "NvAPI_GPU_GetCoolerSettings() failed; error -104"', src\main.rs:705:37
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
DEBUG - Resetting fan control
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "NvAPI_GPU_GetCoolerSettings() failed; error -104"', src\main.rs:82:9
stack backtrace:
   0:     0x7ff60ac8eb6f - backtrace::backtrace::trace_unsynchronized
                               at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.44\src\backtrace\mod.rs:66
   1:     0x7ff60ac8eb6f - std::sys_common::backtrace::_print_fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:78
   2:     0x7ff60ac8eb6f - std::sys_common::backtrace::_print::{{impl}}::fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:59
   3:     0x7ff60aca505b - core::fmt::write
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\fmt\mod.rs:1063
   4:     0x7ff60ac87d6c - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\io\mod.rs:1426
   5:     0x7ff60ac91dfc - std::sys_common::backtrace::_print
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:62
   6:     0x7ff60ac91dfc - std::sys_common::backtrace::print
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\sys_common\backtrace.rs:49
   7:     0x7ff60ac91dfc - std::panicking::default_hook::{{closure}}
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:204
   8:     0x7ff60ac91a4f - std::panicking::default_hook
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:224
   9:     0x7ff60ac925d7 - std::panicking::rust_panic_with_hook
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:470
  10:     0x7ff60ac9215f - std::panicking::begin_panic_handler
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:378
  11:     0x7ff60aca2fc0 - core::panicking::panic_fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\panicking.rs:85
  12:     0x7ff60aca2df3 - core::option::expect_none_failed
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\option.rs:1211
  13:     0x7ff60ac459e0 - <&mut toml::de::Deserializer as serde::de::Deserializer>::deserialize_struct::he6b7ea5729fafcaf
  14:     0x7ff60ac50f32 - nvfancontrol::validate_gpu_id::h65825082353cce93
  15:     0x7ffabfda1030 - <unknown>
  16:     0x7ffabfda4a2b - is_exception_typeof
  17:     0x7ffabfdae3d4 - _C_specific_handler
  18:     0x7ffabfda3cb0 - is_exception_typeof
  19:     0x7ffabfdaed01 - _CxxFrameHandler3
  20:     0x7ffad3d5016f - _chkstk
  21:     0x7ffad3cd1c56 - RtlUnwindEx
  22:     0x7ffabfdae892 - _C_specific_handler
  23:     0x7ffabfda2941 - is_exception_typeof
  24:     0x7ffabfda2d6d - is_exception_typeof
  25:     0x7ffabfda3dac - is_exception_typeof
  26:     0x7ffabfdaed01 - _CxxFrameHandler3
  27:     0x7ffad3d500ef - _chkstk
  28:     0x7ffad3cfb474 - RtlRaiseException
  29:     0x7ffad3cfb1c5 - RtlRaiseException
  30:     0x7ffad1843e49 - RaiseException
  31:     0x7ffabfda61e0 - CxxThrowException
  32:     0x7ff60ac95e51 - panic_unwind::imp::panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libpanic_unwind\seh.rs:308
  33:     0x7ff60ac95dd9 - panic_unwind::__rust_start_panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libpanic_unwind\lib.rs:111
  34:     0x7ff60ac926b8 - std::panicking::rust_panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:522
  35:     0x7ff60ac92691 - std::panicking::rust_panic_with_hook
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:492
  36:     0x7ff60ac9215f - std::panicking::begin_panic_handler
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:378
  37:     0x7ff60aca2fc0 - core::panicking::panic_fmt
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\panicking.rs:85
  38:     0x7ff60aca2df3 - core::option::expect_none_failed
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libcore\option.rs:1211
  39:     0x7ff60ac4cdec - nvfancontrol::validate_gpu_id::h65825082353cce93
  40:     0x7ff60ac53f86 - serde::ser::SerializeMap::serialize_entry::h6dc91f441dc66b58
  41:     0x7ff60ac91ff7 - std::rt::lang_start_internal::{{closure}}
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\rt.rs:52
  42:     0x7ff60ac91ff7 - std::panicking::try::do_call<closure-0,i32>
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:303
  43:     0x7ff60ac95d52 - panic_unwind::__rust_maybe_catch_panic
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libpanic_unwind\lib.rs:86
  44:     0x7ff60ac92818 - std::panicking::try
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panicking.rs:281
  45:     0x7ff60ac92818 - std::panic::catch_unwind
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\panic.rs:394
  46:     0x7ff60ac92818 - std::rt::lang_start_internal
                               at /rustc/8d69840ab92ea7f4d323420088dd8c9775f180cd\/src\libstd\rt.rs:51
  47:     0x7ff60ac51457 - main
  48:     0x7ff60acaf164 - invoke_main
                               at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  49:     0x7ff60acaf164 - __scrt_common_main_seh
                               at d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  50:     0x7ffad37c6fd4 - BaseThreadInitThunk
  51:     0x7ffad3cfcec1 - RtlUserThreadStart
thread panicked while panicking. aborting.

Apparently the 431.36 is the first driver supporting the card, so I guess this never worked for my card

Same result with the 440.97 driver

Yes, obviously there is a problem with the NvAPI_GPU_GetCoolerSettings function of NvAPI. It probably needs NvAPI_GPU_GetClientFanCoolersInfo instead. I know I need to code it into the windows side of the code but it has fallen behind due to my inability to test it properly, sorry :-( . I'll try to get some small binaries for you to test at some point later if you don't mind.

Sure, I can test some binaries. I'm currently trying to use NvAPI myself...
The only thing I really need is a way to just set a value for my fans via a script, but apparently there does not exist any program on windows that can do that? I don't really do any GPU stuff, so I don't know of any libraries or programs. The only things I found that accept cli parameters was this project and nvidiainspector, but this one does not work at all and nvidiainspector can't detect the fan on my GPU... I figured since all the overclocking tools work just fine there has to be some simple cli tool for Windows, but apparently not? Do you happen to know of any windows program that can be controlled by a script and set a certain GPU fan speed?

OK so I think I made some progress. Could you please paste me the output of the attached program?

nvfanissue.zip

Looks like you made some progress :)
level and rpm are what they should be

NVIDIA Driver version: 445.87
Found 1 available GPU(s)
GPU #0: GeForce RTX 2070 SUPER
 COOLER-0
   DBG: Found 1 statuses for GPU
   DBG: 0: NvFanCoolerStatus { id: 1, rpm: 869, minimum: 0, maximum: 100, level: 28, _reserved: [0, 0, 0, 0, 0, 0, 0, 0] }:
  Speed: 28%

That's nice! I think I understand what's wrong. RTX cards do not seem to support the old API at all. I was hoping they would at least support it in a degraded manner instead of crashing. But anyway it's fairly straightforward to support the new functions. I'm wondering if older cards support the new API because that would simplify things a lot; just swap the old calls for the new ones. Otherwise there is going to be a need for two different code paths and that's going to take a little longer to support (and most importantly test: that's the bottleneck). Anyway I'll have a new nvfancontrol binary for testing soon.

I'm going to close this as it's the same issue as #12 so please follow that one for any further updates.