diff --git a/ChangeLog b/ChangeLog index 0e9bc037..12e598cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ * fix number printing in human_readable() * network $upspeed and $downspeed now use human_readable() * Fix diskio_read/write patch sf.net id #2493084 (thanks Alexander) + * Fix nvidia memory frequency reading patch sf.net id #2493134 2009-02-15 * Added out_to_x diff --git a/README b/README index c88a01cc..8b405ce3 100644 --- a/README +++ b/README @@ -1309,13 +1309,14 @@ conky(1) conky(1) Hostname - 1mnvidia threshold temp gpufreq memfreq imagequality0m + 1mnvidia threshold temp ambient gpufreq memfreq imagequality0m Nvidia graficcard support for the XNVCtrl library. Each option can be shortened to the least significant part. Temperatures are printed as float, all other values as integer. 1mthreshold22m: the thresholdtemperature at which the gpu slows down 1mtemp22m: gives the gpu current temperature + 1mambient22m: gives current air temperature near GPU case 1mgpufreq22m: gives the current gpu frequency 1mmemfreq22m: gives the current mem frequency 1mimagequality22m: which imagequality should be choosen by OpenGL ap‐ diff --git a/configure.ac.in b/configure.ac.in index 2855eebf..c771c94b 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -311,29 +311,6 @@ if test x$want_wlan = xyes; then AC_DEFINE(HAVE_IWLIB, 1, [Define if you want wireless support]) 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 IMLIB2 dnl @@ -496,6 +473,29 @@ if test x$want_xft = "xyes"; then 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 GLIB dnl diff --git a/doc/conky.1 b/doc/conky.1 index 7902dc93..1a110264 100644 --- a/doc/conky.1 +++ b/doc/conky.1 @@ -1140,7 +1140,7 @@ not. Both mbox and maildir type mailboxes are supported. Hostname .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. Each option can be shortened to the least significant part. Temperatures are printed as float, all other values as integer. @@ -1151,6 +1151,9 @@ the thresholdtemperature at which the gpu slows down \fBtemp\fR: gives the gpu current temperature .br +\fBambient\fR: +gives current air temperature near GPU case +.br \fBgpufreq\fR: gives the current gpu frequency .br diff --git a/doc/variables.xml b/doc/variables.xml index 05a8eeb5..43d482aa 100644 --- a/doc/variables.xml +++ b/doc/variables.xml @@ -1660,6 +1660,7 @@ + @@ -1675,6 +1676,9 @@ temp: gives the gpu current temperature + ambient: + gives current air temperature near GPU case + gpufreq: gives the current gpu frequency diff --git a/src/nvidia.c b/src/nvidia.c index 4926bb64..06a52516 100644 --- a/src/nvidia.c +++ b/src/nvidia.c @@ -27,9 +27,16 @@ #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 tmp; - if(!XNVCTRLQueryAttribute(dpy, 0, 0, qid, &tmp)){ + if(!XNVCTRLQueryAttribute(dpy, 0, 0, nvidia_query_to_attr[qid], &tmp)){ return -1; } /* 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 return 1; break; + case 'a': // ambient temp + nvidia->print_as_float = 1; + nvidia->type = NV_TEMP_AMBIENT; + break; case 'g': // gpufreq nvidia->type = NV_GPU_FREQ; break; diff --git a/src/nvidia.h b/src/nvidia.h index c0d311f5..071d3b48 100644 --- a/src/nvidia.h +++ b/src/nvidia.h @@ -33,11 +33,12 @@ #include typedef enum _QUERY_ID { - NV_TEMP = NV_CTRL_GPU_CORE_TEMPERATURE, - NV_TEMP_THRESHOLD = NV_CTRL_GPU_CORE_THRESHOLD, - NV_GPU_FREQ = NV_CTRL_GPU_CURRENT_CLOCK_FREQS, - NV_MEM_FREQ = NV_CTRL_GPU_CURRENT_CLOCK_FREQS, - NV_IMAGE_QUALITY = NV_CTRL_IMAGE_SETTINGS + NV_TEMP, + NV_TEMP_THRESHOLD, + NV_TEMP_AMBIENT, + NV_GPU_FREQ, + NV_MEM_FREQ, + NV_IMAGE_QUALITY } QUERY_ID; struct nvidia_s {