19 Commits

Author SHA1 Message Date
Manuel Selinger
4465c14786 Migrate Plugin to Gnome 45 Shell (#267)
* Migrate Plugin to Gnome 45 Shell

* Use TextDecoder instead of ByteArray or toString()

* use the Glib timeout functions

* remove unused imports
2023-10-10 15:06:04 +03:00
Ibrahim Ansari
55bcd7c481 Avoid blocking NVIDIA GPUs from sleeping (#259)
* Only poll NVIDIA GPUs which are awake.

* Slow down polling if an NVIDIA GPU can sleep.
If an NVIDIA GPU is eligible to sleep, i.e. runtime D3 sleep is enabled
and no processes except GNOME or X.org are running, then don't poll the
GPU for at least another 30 seconds.

* NVIDIA: Check for X.org correctly on most distros.
If a distro is naming X.org differently than these common and sensible
names, then we can't detect or account for that in any way unfortunately

* Show N/A instead when NVIDIA GPU is sleeping.
2023-05-17 19:01:17 +03:00
polter
dab42ffc5c nvidiaUtil: code cleanup, fix recognizing the card (#242)
Since the card list is populated only in constructor, to update it we
had to toggle "Nvidia" switch `on`->`off`->`on`.

The fix is to get the temperature along with the card name in one
`nvidia-smi` call.

Also some code cleanup was made, removed old unused code.

Fixes #241

Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
2022-07-09 08:21:51 +03:00
Jonas Malaco
4833a2e190 Switch to nvidia-smi to reduce CPU load when fetching GPU temperatures
At least on one Intel systems (i7-8700K/delidded/watercooled) the
display of the GPU temperature of NVIDIA cards caused perceptible spikes
in CPU utilization, frequency and temperature of individual cores.

This was eventually tracked down to nvidia-settings being substantially
slower and, more importantly, computationally intensive than nvidia-smi.

Switch the nvidiaUtil implementation to use nvidia-smi.  In the process,
simplify the label parsing and label vs. temperature code because
nvidia-smi allows us greater control over the output.
2020-02-21 10:03:49 -03:00
UshakovVasilii
888ce3643e remove error from command output #114 2019-05-12 18:53:28 +03:00
UshakovVasilii
98630647dd update for gnome-shell 3.32 #126 2019-03-20 22:11:27 +03:00
UshakovVasilii
6f9d334cef update for gnome-shell 3.32 #126 2019-03-20 10:28:11 +03:00
Nikita Yustovskiy
26e0b58433 Fixed NaN values when NVIDIA is disabled 2018-10-20 18:58:04 +03:00
Thomas Ingvarsson
b3affd57dc Correct usage of toString on Uint8Array
According to warning given today with gnome 3.30:
"Some code called array.toString() on a Uint8Array instance. Previously this would have interpreted the bytes of the array as a string, but that is nonstandard. In the future this will return the bytes as comma-separated digits. For the time being, the old behavior has been preserved, but please fix your code anyway to explicitly call ByteArray.toString(array)."
2018-09-18 21:52:08 +02:00
UshakovVasilii
5f2569c186 fix gjs errors #98 2018-09-18 13:19:09 +03:00
J.Junquera
bd1d31a847 Fixing my last commit syntax errors. 2017-10-14 12:16:50 +02:00
J.Junquera
0e2b79c735 Fixing Nvidia problems when its disabled with prime-select intel 2017-10-14 00:04:55 +02:00
UshakovVasilii
fd8b74b910 fix NVIDIA GPUs label detection, #58 2017-08-13 10:24:07 +03:00
UshakovVasilii
d9bf184644 fix typo, #32 2017-08-07 23:15:26 +03:00
UshakovVasilii
ba3a394c09 fix logic to skip first line, #32 2017-08-07 16:43:35 +03:00
UshakovVasilii
96c6ac11e4 support multiple NVIDIA gpu, #32 2017-08-07 16:04:49 +03:00
UshakovVasilii
d5777b70d8 clean code 2015-04-11 01:01:16 +03:00
UshakovVasilii
3024c636ef Add NVIDIA card label detection 2014-07-05 02:45:00 +04:00
UshakovVasilii
ffd153cc01 Add NVIDIA card temperature 2014-07-04 22:05:35 +04:00