mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-26 16:48:28 +00:00
Fix nvidia memory frequency reading patch sf.net id #2493134.
This commit is contained in:
parent
966a05a984
commit
24ddc9665e
@ -12,6 +12,7 @@
|
|||||||
* fix number printing in human_readable()
|
* fix number printing in human_readable()
|
||||||
* network $upspeed and $downspeed now use human_readable()
|
* network $upspeed and $downspeed now use human_readable()
|
||||||
* Fix diskio_read/write patch sf.net id #2493084 (thanks Alexander)
|
* Fix diskio_read/write patch sf.net id #2493084 (thanks Alexander)
|
||||||
|
* Fix nvidia memory frequency reading patch sf.net id #2493134
|
||||||
|
|
||||||
2009-02-15
|
2009-02-15
|
||||||
* Added out_to_x
|
* Added out_to_x
|
||||||
|
3
README
3
README
@ -1309,13 +1309,14 @@ conky(1) conky(1)
|
|||||||
Hostname
|
Hostname
|
||||||
|
|
||||||
|
|
||||||
1mnvidia threshold temp gpufreq memfreq imagequality0m
|
1mnvidia threshold temp ambient gpufreq memfreq imagequality0m
|
||||||
Nvidia graficcard support for the XNVCtrl library. Each option
|
Nvidia graficcard support for the XNVCtrl library. Each option
|
||||||
can be shortened to the least significant part. Temperatures
|
can be shortened to the least significant part. Temperatures
|
||||||
are printed as float, all other values as integer.
|
are printed as float, all other values as integer.
|
||||||
|
|
||||||
1mthreshold22m: the thresholdtemperature at which the gpu slows down
|
1mthreshold22m: the thresholdtemperature at which the gpu slows down
|
||||||
1mtemp22m: gives the gpu current temperature
|
1mtemp22m: gives the gpu current temperature
|
||||||
|
1mambient22m: gives current air temperature near GPU case
|
||||||
1mgpufreq22m: gives the current gpu frequency
|
1mgpufreq22m: gives the current gpu frequency
|
||||||
1mmemfreq22m: gives the current mem frequency
|
1mmemfreq22m: gives the current mem frequency
|
||||||
1mimagequality22m: which imagequality should be choosen by OpenGL ap‐
|
1mimagequality22m: which imagequality should be choosen by OpenGL ap‐
|
||||||
|
@ -311,29 +311,6 @@ if test x$want_wlan = xyes; then
|
|||||||
AC_DEFINE(HAVE_IWLIB, 1, [Define if you want wireless support])
|
AC_DEFINE(HAVE_IWLIB, 1, [Define if you want wireless support])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl NVIDIA libXNVCtrl support
|
|
||||||
dnl
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([nvidia],
|
|
||||||
AC_HELP_STRING([--enable-nvidia], [enable if you want nvidia support @<:@default=no@:>@]),
|
|
||||||
[want_nvidia="$enableval"], [want_nvidia=no])
|
|
||||||
if test x$want_nvidia = xyes; then
|
|
||||||
if test "x$want_x11" != "xyes"; then
|
|
||||||
# do nada
|
|
||||||
want_nvidia=no
|
|
||||||
else
|
|
||||||
AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
|
|
||||||
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryVersion], [] ,[AC_MSG_ERROR([grrr])] )
|
|
||||||
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
|
|
||||||
dnl ## am I Stupid ??
|
|
||||||
dnl ## it won't find the lib for some reason!?
|
|
||||||
LIBS="$LIBS -lXNVCtrl"
|
|
||||||
AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl IMLIB2
|
dnl IMLIB2
|
||||||
dnl
|
dnl
|
||||||
@ -496,6 +473,29 @@ if test x$want_xft = "xyes"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl NVIDIA libXNVCtrl support
|
||||||
|
dnl
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([nvidia],
|
||||||
|
AC_HELP_STRING([--enable-nvidia], [enable if you want nvidia support @<:@default=no@:>@]),
|
||||||
|
[want_nvidia="$enableval"], [want_nvidia=no])
|
||||||
|
if test x$want_nvidia = xyes; then
|
||||||
|
if test "x$want_x11" != "xyes"; then
|
||||||
|
# do nada
|
||||||
|
want_nvidia=no
|
||||||
|
else
|
||||||
|
AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
|
||||||
|
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryVersion], [] ,[AC_MSG_ERROR([grrr])] )
|
||||||
|
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
|
||||||
|
dnl ## am I Stupid ??
|
||||||
|
dnl ## it won't find the lib for some reason!?
|
||||||
|
LIBS="$LIBS -lXNVCtrl"
|
||||||
|
AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl GLIB
|
dnl GLIB
|
||||||
dnl
|
dnl
|
||||||
|
@ -1140,7 +1140,7 @@ not. Both mbox and maildir type mailboxes are supported.
|
|||||||
Hostname
|
Hostname
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fB\*(T<\fBnvidia\fR\*(T>\fR \*(T<\fBthreshold\fR\*(T> \*(T<\fBtemp\fR\*(T> \*(T<\fBgpufreq\fR\*(T> \*(T<\fBmemfreq\fR\*(T> \*(T<\fBimagequality\fR\*(T>
|
\fB\*(T<\fBnvidia\fR\*(T>\fR \*(T<\fBthreshold\fR\*(T> \*(T<\fBtemp\fR\*(T> \*(T<\fBambient\fR\*(T> \*(T<\fBgpufreq\fR\*(T> \*(T<\fBmemfreq\fR\*(T> \*(T<\fBimagequality\fR\*(T>
|
||||||
Nvidia graficcard support for the XNVCtrl library.
|
Nvidia graficcard support for the XNVCtrl library.
|
||||||
Each option can be shortened to the least significant part.
|
Each option can be shortened to the least significant part.
|
||||||
Temperatures are printed as float, all other values as integer.
|
Temperatures are printed as float, all other values as integer.
|
||||||
@ -1151,6 +1151,9 @@ the thresholdtemperature at which the gpu slows down
|
|||||||
\fBtemp\fR:
|
\fBtemp\fR:
|
||||||
gives the gpu current temperature
|
gives the gpu current temperature
|
||||||
.br
|
.br
|
||||||
|
\fBambient\fR:
|
||||||
|
gives current air temperature near GPU case
|
||||||
|
.br
|
||||||
\fBgpufreq\fR:
|
\fBgpufreq\fR:
|
||||||
gives the current gpu frequency
|
gives the current gpu frequency
|
||||||
.br
|
.br
|
||||||
|
@ -1660,6 +1660,7 @@
|
|||||||
<command><option>nvidia</option></command>
|
<command><option>nvidia</option></command>
|
||||||
<option>threshold</option>
|
<option>threshold</option>
|
||||||
<option>temp</option>
|
<option>temp</option>
|
||||||
|
<option>ambient</option>
|
||||||
<option>gpufreq</option>
|
<option>gpufreq</option>
|
||||||
<option>memfreq</option>
|
<option>memfreq</option>
|
||||||
<option>imagequality</option>
|
<option>imagequality</option>
|
||||||
@ -1675,6 +1676,9 @@
|
|||||||
<member><command>temp</command>:
|
<member><command>temp</command>:
|
||||||
gives the gpu current temperature
|
gives the gpu current temperature
|
||||||
</member>
|
</member>
|
||||||
|
<member><command>ambient</command>:
|
||||||
|
gives current air temperature near GPU case
|
||||||
|
</member>
|
||||||
<member><command>gpufreq</command>:
|
<member><command>gpufreq</command>:
|
||||||
gives the current gpu frequency
|
gives the current gpu frequency
|
||||||
</member>
|
</member>
|
||||||
|
13
src/nvidia.c
13
src/nvidia.c
@ -27,9 +27,16 @@
|
|||||||
|
|
||||||
#include "nvidia.h"
|
#include "nvidia.h"
|
||||||
|
|
||||||
|
const int nvidia_query_to_attr[] = {NV_CTRL_GPU_CORE_TEMPERATURE,
|
||||||
|
NV_CTRL_GPU_CORE_THRESHOLD,
|
||||||
|
NV_CTRL_AMBIENT_TEMPERATURE,
|
||||||
|
NV_CTRL_GPU_CURRENT_CLOCK_FREQS,
|
||||||
|
NV_CTRL_GPU_CURRENT_CLOCK_FREQS,
|
||||||
|
NV_CTRL_IMAGE_SETTINGS};
|
||||||
|
|
||||||
int get_nvidia_value(QUERY_ID qid, Display *dpy){
|
int get_nvidia_value(QUERY_ID qid, Display *dpy){
|
||||||
int tmp;
|
int tmp;
|
||||||
if(!XNVCTRLQueryAttribute(dpy, 0, 0, qid, &tmp)){
|
if(!XNVCTRLQueryAttribute(dpy, 0, 0, nvidia_query_to_attr[qid], &tmp)){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* FIXME: when are the low 2 bytes of NV_GPU_FREQ needed? */
|
/* FIXME: when are the low 2 bytes of NV_GPU_FREQ needed? */
|
||||||
@ -56,6 +63,10 @@ int set_nvidia_type(struct nvidia_s *nvidia, const char *arg)
|
|||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
|
case 'a': // ambient temp
|
||||||
|
nvidia->print_as_float = 1;
|
||||||
|
nvidia->type = NV_TEMP_AMBIENT;
|
||||||
|
break;
|
||||||
case 'g': // gpufreq
|
case 'g': // gpufreq
|
||||||
nvidia->type = NV_GPU_FREQ;
|
nvidia->type = NV_GPU_FREQ;
|
||||||
break;
|
break;
|
||||||
|
11
src/nvidia.h
11
src/nvidia.h
@ -33,11 +33,12 @@
|
|||||||
#include <NVCtrl/NVCtrlLib.h>
|
#include <NVCtrl/NVCtrlLib.h>
|
||||||
|
|
||||||
typedef enum _QUERY_ID {
|
typedef enum _QUERY_ID {
|
||||||
NV_TEMP = NV_CTRL_GPU_CORE_TEMPERATURE,
|
NV_TEMP,
|
||||||
NV_TEMP_THRESHOLD = NV_CTRL_GPU_CORE_THRESHOLD,
|
NV_TEMP_THRESHOLD,
|
||||||
NV_GPU_FREQ = NV_CTRL_GPU_CURRENT_CLOCK_FREQS,
|
NV_TEMP_AMBIENT,
|
||||||
NV_MEM_FREQ = NV_CTRL_GPU_CURRENT_CLOCK_FREQS,
|
NV_GPU_FREQ,
|
||||||
NV_IMAGE_QUALITY = NV_CTRL_IMAGE_SETTINGS
|
NV_MEM_FREQ,
|
||||||
|
NV_IMAGE_QUALITY
|
||||||
} QUERY_ID;
|
} QUERY_ID;
|
||||||
|
|
||||||
struct nvidia_s {
|
struct nvidia_s {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user