jmarucha / FanControl.Liquidctl

Get access to the pump and temperature sensors of your AIO in FanControl
GNU General Public License v3.0
40 stars 17 forks source link

High CPU usage (Root of the problem) #20

Closed brunoherrera closed 1 year ago

brunoherrera commented 1 year ago

Follow up of High CPU Usage (Antimalware Service Executable)

The root of the issue is that liquidctl.exe is constantly being opened and closed, I think 2 times per second, maybe more, checking resource monitor its constantly writing to %LocalAppData%/Temp, folders named something like: _MEI154122, constantly modifying, deleting and creating thema gain and again, I added appdata folder to windows defender exclusions and it fixed the Antimalware Service Executable (MsMpEng.exe) high cpu issue, but opening and closing liquidctl.exe still makes the CPU work too much and temps rise anyways.

I'll disable the plugin and use HWiNFO instead untill this gets sorted out.

cytrus224 commented 1 year ago

One way to fix it. Whitelist entire FanControl folder in Windows Defender. Instant fix to high CPU usage

brunoherrera commented 1 year ago

One way to fix it. Whitelist entire FanControl folder in Windows Defender. Instant fix to high CPU usage

that's not a fix, liquidctl.exe is constantly being open and closed, making unnecessary writes to storage and taxing the cpu, rising temperatures.

hmmm, maybe its Fan Control that is trying to poll the exe the same way it does with dll files, when it should just do that only with the dll's, but liquidctl should actualy let us know if that's the case so we can open an issue in fan control. EDIT: It is polling the exe the same way it does the dll's, but it's just the way it is, liquidctl works that way and is not efficient. I found a workaround launching it (liquidctl.exe) with task scheduler and argument initialize all, it lets me use HWiNFO for liquid temperature and pump speed reliably.

brunoherrera commented 1 year ago

@jmarucha maybe you can change liquidctl.exe out of plugins fodler so it isn't called by FanControl every second? I tried changing LiquidctlCLIWrapper.cs:11 to public static string liquidctlexe = "liquidctl\liquidctl.exe"; But I'm a mess in windows with WSL and python3, it has some errors when executing build-liquidctl.sh, so becasue I don't even know if changing that line in wrapper.cs will work and re-path I'll just quit, but please move that .exe out of plugins folder

SuspiciousActivity commented 1 year ago

Since this issue was bugging me for some time now, I made a custom fork of liquidctl and this plugin, which stops liquidctl from starting every second by using a custom made interactive mode in liquidctl. Haven't tested it at all on anything else than my computer, so use at your own risk if you want to. I'm just leaving this here if anyone more knowledgable is interested in using this approach and maybe commit a better change to liquidctl and this plugin and needs a base start which works. Link

momala454 commented 1 year ago

@SuspiciousActivity could you create pull requests on the original repos ?

brunoherrera commented 1 year ago

Since this issue was bugging me for some time now, I made a custom fork of liquidctl and this plugin, which stops liquidctl from starting every second by using a custom made interactive mode in liquidctl. Haven't tested it at all on anything else than my computer, so use at your own risk if you want to. I'm just leaving this here if anyone more knowledgable is interested in using this approach and maybe commit a better change to liquidctl and this plugin and needs a base start which works. Link

works in my pc with Kraken X73, thanks!!!

kromosomX commented 1 year ago

Since this issue was bugging me for some time now, I made a custom fork of liquidctl and this plugin, which stops liquidctl from starting every second by using a custom made interactive mode in liquidctl. Haven't tested it at all on anything else than my computer, so use at your own risk if you want to. I'm just leaving this here if anyone more knowledgable is interested in using this approach and maybe commit a better change to liquidctl and this plugin and needs a base start which works. Link

Hi,

I tried to use your fork, but I get "LiquidctlPlugin could not initialize or has no sensors." message when starting Fan Control (v149). Liquidctl is working OK, beacause if run liquidctl status I get:

ASUS Aura LED Controller (experimental) ├── ARGB channels: 3 └── RGB channels: 1 Asetek 690LC (assuming EVGA CLC) ├── Liquid temperature 34.7 °C ├── Fan speed 0 rpm ├── Pump speed 2910 rpm └── Firmware version 2.10.0.0

I think that it fails because it's trying to interpre "Firmware version" as sensor data... because I get this in the Fan Control log:

    1. 2023 18:20:02: Newtonsoft.Json.JsonReaderException: Could not convert string to double: 2.10.0.0. Path '[1].status[3].value', line 1, position 587. at Newtonsoft.Json.JsonReader.ReadDoubleString(String s) at Newtonsoft.Json.JsonTextReader.FinishReadQuotedNumber(ReadType readType) at Newtonsoft.Json.JsonTextReader.ReadAsDouble() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at FanControl.Liquidctl.LiquidctlCLIWrapper.ReadStatus() at FanControl.Liquidctl.LiquidctlPlugin.Load(IPluginSensorsContainer _container) at FanControl.Domain.BackendProviders.Plugin.PluginBackendProvider.Open()
brunoherrera commented 1 year ago

@kromosomX that should go in the issues section of the fork, I will cite the following comment from @jmarucha in regards to the executable needed for liquidctl:

In the case of that specific plugin, sadly yes, it would seem to be highly inefficient since it most likely call the exe at every update cycle ( 1 Hz ) to push and pull the information.

That's specific to that plugin implementation.

and since @SuspiciousActivity solution works for me I'll close this issue

jmarucha commented 1 year ago

@SuspiciousActivity have you tried talking to LiquidCTL team? The idea is amazing and I think they may be willing to get it upstream.

xkutaca commented 1 year ago

I am having issues with it recognizing a nzxt smart device 2, it works with my x72 but not the smart device 2