Conky: libxnvctrl build error

Created on 10 Jun 2018  Â·  55Comments  Â·  Source: brndnmtthws/conky

Using nvidia-settings-396-24 libxnvctrl and this is what happens:

[ 97%] Building CXX object src/CMakeFiles/conky.dir/irc.cc.o
cd /tmp/SBo/conky-git20180610/build/src && /usr/bin/c++ -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L -I/tmp/SBo/conky-git20180610/build -I/usr/include/mysql -I/usr/include/freetype2 -I/usr/include/libxml2 -I/tmp/SBo/conky-git20180610/build/data -std=c++17 -O2 -fPIC -O3 -DNDEBUG -std=gnu++1z -o CMakeFiles/conky.dir/irc.cc.o -c /tmp/SBo/conky-git20180610/src/irc.cc
/tmp/SBo/conky-git20180610/src/nvidia.cc: In function 'int get_nvidia_target_count(Display, TARGET_ID)':
/tmp/SBo/conky-git20180610/src/nvidia.cc:651:76: error: 'XNVCTRLQueryTargetCount' was not declared in this scope
if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) {
^
/tmp/SBo/conky-git20180610/src/nvidia.cc: In function 'int cache_nvidia_value(TARGET_ID, ATTR_ID, Display
, int, int)':
/tmp/SBo/conky-git20180610/src/nvidia.cc:678:61: error: 'XNVCTRLQueryTargetAttribute' was not declared in this scope
translate_nvidia_attribute[aid], value)) {
^
/tmp/SBo/conky-git20180610/src/nvidia.cc:692:61: error: 'XNVCTRLQueryTargetAttribute' was not declared in this scope
translate_nvidia_attribute[aid], value)) {
^
/tmp/SBo/conky-git20180610/src/nvidia.cc: In function 'int get_nvidia_value(TARGET_ID, ATTR_ID, int)':
/tmp/SBo/conky-git20180610/src/nvidia.cc:721:77: error: 'XNVCTRLQueryTargetAttribute' was not declared in this scope
translate_nvidia_attribute[aid], &value)) {
^
/tmp/SBo/conky-git20180610/src/nvidia.cc: In function 'char
get_nvidia_string(TARGET_ID, ATTR_ID, int)':
/tmp/SBo/conky-git20180610/src/nvidia.cc:745:56: error: 'XNVCTRLQueryTargetStringAttribute' was not declared in this scope
translate_nvidia_attribute[aid], &str)) {
^
src/CMakeFiles/conky.dir/build.make:764: recipe for target 'src/CMakeFiles/conky.dir/nvidia.cc.o' failed
make[2]: * [src/CMakeFiles/conky.dir/nvidia.cc.o] Error 1
make[2]:
Waiting for unfinished jobs....
make[2]: Leaving directory '/tmp/SBo/conky-git20180610/build'
CMakeFiles/Makefile2:562: recipe for target 'src/CMakeFiles/conky.dir/all' failed
make[1]:
[src/CMakeFiles/conky.dir/all] Error 2
make[1]: Leaving directory '/tmp/SBo/conky-git20180610/build'
Makefile:151: recipe for target 'all' failed
make: *
[all] Error 2

bug major

Most helpful comment

You forgot the perhaps ?

All 55 comments

I can confirm this. Error log is here.

Same.

[ 95%] Building CXX object src/CMakeFiles/conky.dir/imlib2.cc.o                                                                     
[ 96%] Building CXX object src/CMakeFiles/conky.dir/apcupsd.cc.o                                                                    
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_target_count(Display*, TARGET_ID)’:                                
/home/chris/src/conky/src/nvidia.cc:651:8: error: ‘XNVCTRLQueryTargetCount’ was not declared in this scope                          
   if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) {                                                    
        ^~~~~~~~~~~~~~~~~~~~~~~                                                                                                     
/home/chris/src/conky/src/nvidia.cc: In function ‘int cache_nvidia_value(TARGET_ID, ATTR_ID, Display*, int*, int)’:                 
/home/chris/src/conky/src/nvidia.cc:676:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope                     
       if (!dpy || !XNVCTRLQueryTargetAttribute(                                                                                    
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                     
/home/chris/src/conky/src/nvidia.cc:690:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope                     
       if (!dpy || !XNVCTRLQueryTargetAttribute(                                                                                    
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                     
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_value(TARGET_ID, ATTR_ID, int)’:                                   
/home/chris/src/conky/src/nvidia.cc:720:10: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope                     
         !XNVCTRLQueryTargetAttribute(dpy, translate_nvidia_target[tid], gid, 0,                                                    
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                               
/home/chris/src/conky/src/nvidia.cc: In function ‘char* get_nvidia_string(TARGET_ID, ATTR_ID, int)’:                                
/home/chris/src/conky/src/nvidia.cc:743:16: error: ‘XNVCTRLQueryTargetStringAttribute’ was not declared in this scope               
   if (!dpy || !XNVCTRLQueryTargetStringAttribute(                                                                                  
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                   
make[2]: *** [src/CMakeFiles/conky.dir/build.make:726: src/CMakeFiles/conky.dir/nvidia.cc.o] Error 1                                
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:218: src/CMakeFiles/conky.dir/all] Error 2                                                       
make: *** [Makefile:152: all] Error 2         

@lasers I don't have nvidia gpu to test this out :{

@su8 I do. A regular one. Can you figure out from here and send diffs my way? Hardcore mode.

@su8 What do you need from me? nvidia is important for many users. Need this in 1.9.

@lasers You need to find out which header file contains XNVCTRLQueryTargetAttribute , XNVCTRLQueryTargetStringAttribute as /usr/include/NVCtrl/NVCtrlib.h maybe doesn't include those functions anymore.

You can type grep -Ril 'XNVCTRLQueryTargetAttribute' /usr/include grep -Ril 'XNVCTRLQueryTargetStringAttribute' /usr/include

% grep -Ril 'XNVCTRLQueryTargetAttribute' /usr/include
/usr/include/NVCtrl/NVCtrl.h
/usr/include/NVCtrl/NVCtrlLib.h
% grep -Ril 'XNVCTRLQueryTargetStringAttribute' /usr/include
/usr/include/NVCtrl/NVCtrl.h
/usr/include/NVCtrl/NVCtrlLib.h
diff --git a/src/nvidia.cc b/src/nvidia.cc
index 16e76646..4a5375c1 100644
--- a/src/nvidia.cc
+++ b/src/nvidia.cc
 #include "nvidia.h"
+#include <NVCtrl/NVCtrl.h>
 #include <NVCtrl/NVCtrlLib.h>
 #include "conky.h"
 #include "logging.h"
[ 93%] Building CXX object src/CMakeFiles/conky.dir/nvidia.cc.o                                                          
/home/chris/src/conky/src/nvidia.cc:94:10: fatal error: NVCtrl.h: No such file or directory                              
 #include <NVCtrl.h>                                                                                                     
          ^~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/conky.dir/build.make:739: src/CMakeFiles/conky.dir/nvidia.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:218: src/CMakeFiles/conky.dir/all] Error 2                                            
make: *** [Makefile:152: all] Error 2

I've edited it to

How do I log this to a file? It worked, but I think it's bunch of gcc errors.

make -j4 2>&1 >> log.txt

What about logging cmake?

cmake .. 2>&1 >> log.txt

Same thing. It does not log everything.

Partial...

/usr/include/NVCtrl/NVCtrlLib.h:802:5: note: the macro ‘Bool’ had not yet been defined                              
In file included from /home/chris/src/conky/src/x11.h:30,
                 from /home/chris/src/conky/src/nvidia.cc:99:                                                       
/usr/include/X11/Xlib.h:82: note: it was later defined here                                                         
 #define Bool int

In file included from /home/chris/src/conky/src/nvidia.cc:95:                                                       
/usr/include/NVCtrl/NVCtrlLib.h:819:5: error: ‘Bool’ does not name a type                                           
     Bool send_event;  /* always FALSE, we don't allow send_events */                                               
     ^~~~
/usr/include/NVCtrl/NVCtrlLib.h:819:5: note: the macro ‘Bool’ had not yet been defined                              
In file included from /home/chris/src/conky/src/x11.h:30,
                 from /home/chris/src/conky/src/nvidia.cc:99:                                                       
/usr/include/X11/Xlib.h:82: note: it was later defined here                                                         
 #define Bool int

In file included from /home/chris/src/conky/src/nvidia.cc:95:                                                       
/usr/include/NVCtrl/NVCtrlLib.h:820:5: error: ‘Display’ does not name a type; did you mean ‘DisplayCells’?          
     Display *display;
     ^~~~~~~
     DisplayCells
/usr/include/NVCtrl/NVCtrlLib.h:821:5: error: ‘Time’ does not name a type; did you mean ‘True’?                     
     Time time;
     ^~~~
     True
/usr/include/NVCtrl/NVCtrlLib.h:843:5: error: ‘Bool’ does not name a type                                           
     Bool send_event;  /* always FALSE, we don't allow send_events */                                               
     ^~~~
/usr/include/NVCtrl/NVCtrlLib.h:843:5: note: the macro ‘Bool’ had not yet been defined                              
In file included from /home/chris/src/conky/src/x11.h:30,
                 from /home/chris/src/conky/src/nvidia.cc:99:                                                       
/usr/include/X11/Xlib.h:82: note: it was later defined here                                                         
 #define Bool int

In file included from /home/chris/src/conky/src/nvidia.cc:95:                                                       
/usr/include/NVCtrl/NVCtrlLib.h:844:5: error: ‘Display’ does not name a type; did you mean ‘DisplayCells’?          
     Display *display;
     ^~~~~~~
     DisplayCells
/usr/include/NVCtrl/NVCtrlLib.h:845:5: error: ‘Time’ does not name a type; did you mean ‘True’?                     
     Time time;
     ^~~~
     True
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_target_count(Display*, TARGET_ID)’:                
/home/chris/src/conky/src/nvidia.cc:652:8: error: ‘XNVCTRLQueryTargetCount’ was not declared in this scope          
   if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) {                                    
        ^~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc: In function ‘int cache_nvidia_value(TARGET_ID, ATTR_ID, Display*, int*, int)’: 
/home/chris/src/conky/src/nvidia.cc:677:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope     
       if (!dpy || !XNVCTRLQueryTargetAttribute(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc:691:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope     
       if (!dpy || !XNVCTRLQueryTargetAttribute(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_value(TARGET_ID, ATTR_ID, int)’:                   
/home/chris/src/conky/src/nvidia.cc:721:10: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope     
         !XNVCTRLQueryTargetAttribute(dpy, translate_nvidia_target[tid], gid, 0,                                    
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc: In function ‘char* get_nvidia_string(TARGET_ID, ATTR_ID, int)’:                
/home/chris/src/conky/src/nvidia.cc:744:16: error: ‘XNVCTRLQueryTargetStringAttribute’ was not declared in this scope
   if (!dpy || !XNVCTRLQueryTargetStringAttribute(
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/conky.dir/build.make:739: src/CMakeFiles/conky.dir/nvidia.cc.o] Error 1                
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:218: src/CMakeFiles/conky.dir/all] Error 2                                       
make: *** [Makefile:152: all] Error 2
diff --git a/src/nvidia.cc b/src/nvidia.cc
index 16e76646..3bf241cc 100644
--- a/src/nvidia.cc
+++ b/src/nvidia.cc
@@ -90,12 +90,13 @@
  * [gradient color 2] [scale] [-t] [-l] gpu_id}
  */

+#include "x11.h"
 #include "nvidia.h"
+#include <NVCtrl/NVCtrl.h>
 #include <NVCtrl/NVCtrlLib.h>
 #include "conky.h"
 #include "logging.h"
 #include "temphelper.h"
-#include "x11.h"

Partial...

 static inline int get_nvidia_target_count(Display *dpy, TARGET_ID tid) {                                                                             
                                                                   ^~~                                                                                
/home/chris/src/conky/src/nvidia.cc:650:70: error: expression list treated as compound expression in initializer [-fpermissive]                       
 static inline int get_nvidia_target_count(Display *dpy, TARGET_ID tid) {                                                                             
                                                                      ^                                                                               
/home/chris/src/conky/src/nvidia.cc:671:59: error: ‘Display’ has not been declared                                                                    
 static int cache_nvidia_value(TARGET_ID tid, ATTR_ID aid, Display *dpy,                                                                              
                                                           ^~~~~~~                                                                                    
/home/chris/src/conky/src/nvidia.cc: In function ‘int cache_nvidia_value(TARGET_ID, ATTR_ID, int*, int*, int)’:                                       
/home/chris/src/conky/src/nvidia.cc:677:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope                                       
       if (!dpy || !XNVCTRLQueryTargetAttribute(                                                                                                      
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                       
/home/chris/src/conky/src/nvidia.cc:691:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope                                       
       if (!dpy || !XNVCTRLQueryTargetAttribute(                                                                                                      
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                       
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_value(TARGET_ID, ATTR_ID, int)’:                                                     
/home/chris/src/conky/src/nvidia.cc:710:3: error: ‘Display’ was not declared in this scope                                                            
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
   ^~~~~~~                                                                                                                                            
/home/chris/src/conky/src/nvidia.cc:710:12: error: ‘dpy’ was not declared in this scope                                                               
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
            ^~~                                                                                                                                       
/home/chris/src/conky/src/nvidia.cc:710:18: error: ‘nvdisplay’ was not declared in this scope                                                         
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
                  ^~~~~~~~~                                                                                                                           
/home/chris/src/conky/src/nvidia.cc:710:42: error: ‘display’ was not declared in this scope                                                           
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
                                          ^~~~~~~                                                                                                     
/home/chris/src/conky/src/nvidia.cc:721:10: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope                                       
         !XNVCTRLQueryTargetAttribute(dpy, translate_nvidia_target[tid], gid, 0,                                                                      
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                 
/home/chris/src/conky/src/nvidia.cc: In function ‘char* get_nvidia_string(TARGET_ID, ATTR_ID, int)’:                                                  
/home/chris/src/conky/src/nvidia.cc:740:3: error: ‘Display’ was not declared in this scope                                                            
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
   ^~~~~~~                                                                                                                                            
/home/chris/src/conky/src/nvidia.cc:740:12: error: ‘dpy’ was not declared in this scope                                                               
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
            ^~~                                                                                                                                       
/home/chris/src/conky/src/nvidia.cc:740:18: error: ‘nvdisplay’ was not declared in this scope                                                         
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
                  ^~~~~~~~~                                                                                                                           
/home/chris/src/conky/src/nvidia.cc:740:42: error: ‘display’ was not declared in this scope                                                           
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
                                          ^~~~~~~                                                                                                     
/home/chris/src/conky/src/nvidia.cc:744:16: error: ‘XNVCTRLQueryTargetStringAttribute’ was not declared in this scope                                 
   if (!dpy || !XNVCTRLQueryTargetStringAttribute(                                                                                                    
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                     
/home/chris/src/conky/src/nvidia.cc: In function ‘void print_nvidia_value(text_object*, char*, int)’:                                                 
/home/chris/src/conky/src/nvidia.cc:885:3: error: ‘Display’ was not declared in this scope                                                            
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
   ^~~~~~~                                                                                                                                            
/home/chris/src/conky/src/nvidia.cc:885:12: error: ‘dpy’ was not declared in this scope                                                               
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
            ^~~                                                                                                                                       
/home/chris/src/conky/src/nvidia.cc:885:18: error: ‘nvdisplay’ was not declared in this scope                                                         
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
                  ^~~~~~~~~                                                                                                                           
/home/chris/src/conky/src/nvidia.cc:885:42: error: ‘display’ was not declared in this scope                                                           
   Display *dpy = nvdisplay ? nvdisplay : display;                                                                                                    
                                          ^~~~~~~                                                                                                     
/home/chris/src/conky/src/nvidia.cc:888:63: error: ‘get_nvidia_target_count’ cannot be used as a function                                             
   static int num_GPU = get_nvidia_target_count(dpy, TARGET_GPU) - 1;                                                                                 
                                                               ^                                                                                      
make[2]: *** [src/CMakeFiles/conky.dir/build.make:739: src/CMakeFiles/conky.dir/nvidia.cc.o] Error 1                                                  
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:218: src/CMakeFiles/conky.dir/all] Error 2                                                                         
make: *** [Makefile:152: all] Error 2   

@su8

diff --git a/src/nvidia.cc b/src/nvidia.cc
index 16e76646..a2cfc043 100644
--- a/src/nvidia.cc
+++ b/src/nvidia.cc
@@ -91,7 +91,9 @@
  */

 #include "nvidia.h"
-#include <NVCtrl/NVCtrlLib.h>
+#include <X11/Xlib.h>
+#include "NVCtrl/NVCtrl.h"
+#include "NVCtrl/NVCtrlLib.h"
 #include "conky.h"
 #include "logging.h"
 #include "temphelper.h"
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff701054d in XQueryExtension () from /usr/lib/libX11.so.6
(gdb) bt full
#0  0x00007ffff701054d in XQueryExtension () from /usr/lib/libX11.so.6
No symbol table info available.
#1  0x00007ffff70040e2 in XInitExtension () from /usr/lib/libX11.so.6
No symbol table info available.
#2  0x00007ffff6dd318f in XextAddDisplay () from /usr/lib/libXext.so.6
No symbol table info available.
#3  0x00007ffff5fd4b0c in XNVCTRLQueryTargetCount () from /usr/lib/libXNVCtrl.so.0
No symbol table info available.
#4  0x00005555555d4a84 in get_nvidia_target_count (tid=TARGET_GPU, dpy=0x0) at /home/chris/src/conky/src/nvidia.cc:655
        num_tgts = 0
        num_tgts = <optimized out>
        __func__ = "get_nvidia_target_count"
#5  print_nvidia_value(text_object*, char*, int) () at /home/chris/src/conky/src/nvidia.cc:891
        nvs = 0x55555586b570
        value = <optimized out>
        temp1 = <optimized out>
        temp2 = <optimized out>
        str = 0x0
        dpy = 0x0
        num_GPU = 0
#6  0x0000555555575e43 in generate_text_internal (p=0x55555586ba6c "", p@entry=0x55555586ba60 "    NVIDIA: ", p_max_size=16372, root=...)
    at /home/chris/src/conky/src/conky.cc:861
        obj = 0x55555586b4e0
        a = <optimized out>
#7  0x0000555555578b0d in generate_text () at /usr/include/c++/8.1.1/bits/unique_ptr.h:342
        i = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        p = 0x55555586ba60 "    NVIDIA: "
        j = <optimized out>
        time = <optimized out>
        p = <optimized out>
        i = <optimized out>
        j = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        time = <optimized out>
        tmp_p = <optimized out>
#8  update_text () at /home/chris/src/conky/src/conky.cc:1981
No locals.
#9  0x000055555557b108 in main_loop () at /home/chris/src/conky/src/conky.cc:2407
        time_to_sleep = -1.2472784720011987
        seconds = <optimized out>
        nanos = <optimized out>
        req = {tv_sec = -2, tv_nsec = 752721527}
        rem = {tv_sec = 93824995321680, tv_nsec = 93824995319312}
        terminate = 0
        t = <optimized out>
        inotify_config_wd = -1
        inotify_buff = '\000' <repeats 249 times>...
#10 0x000055555556bd78 in main () at /home/chris/src/conky/src/conky.cc:3172
        curl_global = <optimized out>
#11 0x00007ffff4c3906b in __libc_start_main () from /usr/lib/libc.so.6
No symbol table info available.
#12 0x0000555555570b1a in _start () at /home/chris/src/conky/src/conky.cc:3222
No symbol table info available.

@lasers Nice one. Can you compile the master branch with -ggdb flag:

diff --git a/cmake/ConkyBuildOptions.cmake b/cmake/ConkyBuildOptions.cmake
index e9584c9d..c4602c25 100644
--- a/cmake/ConkyBuildOptions.cmake
+++ b/cmake/ConkyBuildOptions.cmake
@@ -32,8 +32,8 @@ if(NOT CMAKE_BUILD_TYPE)
 endif(NOT CMAKE_BUILD_TYPE)

 # -std options for all build types
-set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}" CACHE STRING "Flags used by the C compiler during all build types." FORCE)
-set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the C++ compiler during all build types." 
FORCE)
+set(CMAKE_C_FLAGS "-std=c99 -ggdb ${CMAKE_C_FLAGS}" CACHE STRING "Flags used by the C compiler during all build ty
pes." FORCE)
+set(CMAKE_CXX_FLAGS "-std=c++17 -ggdb ${CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the C++ compiler during all 
build types." FORCE)
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)

There is #include "NVCtrl/nv_control.h" too, but I think we don't need it. It throws problems anyway.

Is this from git diff? I'm getting an error.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff73cb54d in XQueryExtension () from /usr/lib/libX11.so.6
(gdb) bt full
#0  0x00007ffff73cb54d in XQueryExtension () from /usr/lib/libX11.so.6                                                              
No symbol table info available.
#1  0x00007ffff73bf0e2 in XInitExtension () from /usr/lib/libX11.so.6                                                               
No symbol table info available.
#2  0x00007ffff718c18f in XextAddDisplay () from /usr/lib/libXext.so.6                                                              
No symbol table info available.
#3  0x00007ffff659bb0c in XNVCTRLQueryTargetCount () from /usr/lib/libXNVCtrl.so.0
No symbol table info available.
#4  0x00005555555d4a84 in get_nvidia_target_count (tid=TARGET_GPU, dpy=0x0)
    at /home/chris/src/conky/src/nvidia.cc:655
        num_tgts = 0
        num_tgts = <optimized out>
        __func__ = "get_nvidia_target_count"
#5  print_nvidia_value(text_object*, char*, int) () at /home/chris/src/conky/src/nvidia.cc:891
        nvs = 0x55555586b570
        value = <optimized out>
        temp1 = <optimized out>
        temp2 = <optimized out>
        str = 0x0
        dpy = 0x0
        num_GPU = 0
#6  0x0000555555575e43 in generate_text_internal (p=0x55555586ba6c "", p@entry=0x55555586ba60 "    NVIDIA: ",
    p_max_size=16372, root=...) at /home/chris/src/conky/src/conky.cc:861
        obj = 0x55555586b4e0
        a = <optimized out>
#7  0x0000555555578b0d in generate_text () at /usr/include/c++/8.1.1/bits/unique_ptr.h:342
        i = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        p = 0x55555586ba60 "    NVIDIA: "
---Type <return> to continue, or q <return> to quit---
        j = <optimized out>
        time = <optimized out>
        p = <optimized out>
        i = <optimized out>
        j = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        time = <optimized out>
        tmp_p = <optimized out>
#8  update_text () at /home/chris/src/conky/src/conky.cc:1981
No locals.
#9  0x000055555557b108 in main_loop () at /home/chris/src/conky/src/conky.cc:2407                                                   
        time_to_sleep = -1.2760316620001504                                                                                         
        seconds = <optimized out>
        nanos = <optimized out>
        req = {tv_sec = -2, tv_nsec = 723968337}                                                                                    
        rem = {tv_sec = 93824995321680, tv_nsec = 93824995319312}                                                                   
        terminate = 0                                                                                                               
        t = <optimized out>
        inotify_config_wd = -1                                                                                                      
        inotify_buff = '\000' <repeats 249 times>...                                                                                
#10 0x000055555556bd78 in main () at /home/chris/src/conky/src/conky.cc:3172                                                        
        curl_global = <optimized out>
#11 0x00007ffff57ef003 in __libc_start_main () from /usr/lib/libc.so.6
No symbol table info available.
#12 0x0000555555570b1a in _start () at /home/chris/src/conky/src/conky.cc:3222
No symbol table info available.

Oh instead -ggdb try with -g2 (will print most information) or just -g

Is that correct... #312 closed via #588 too? Will -g2.

Program received signal SIGSEGV, Segmentation fault.

#4  0x00005555555d51d4 in get_nvidia_target_count (tid=TARGET_GPU, dpy=0x0) at /home/chris/src/conky/src/nvidia.cc:653
        num_tgts = 0
        num_tgts = <optimized out>
        __func__ = "get_nvidia_target_count"
#5  print_nvidia_value(text_object*, char*, int) () at /home/chris/src/conky/src/nvidia.cc:889
        nvs = 0x55555566d570
        value = <optimized out>
        temp1 = <optimized out>
        temp2 = <optimized out>
        str = 0x0
        dpy = 0x0
        num_GPU = 0
#6  0x0000555555576483 in generate_text_internal (p=0x55555566da6c "", p@entry=0x55555566da60 "    NVIDIA: ", p_max_size=16372,
    root=...) at /home/chris/src/conky/src/conky.cc:861
        obj = 0x55555566d4e0
        a = <optimized out>
#7  0x000055555557914d in generate_text () at /usr/include/c++/8.2.0/bits/unique_ptr.h:342
        i = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        p = 0x55555566da60 "    NVIDIA: "
        j = <optimized out>
        time = <optimized out>
        p = <optimized out>
        i = <optimized out>
        j = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        time = <optimized out>
        tmp_p = <optimized out>
#8  update_text () at /home/chris/src/conky/src/conky.cc:1981
No locals.
#9  0x000055555557b748 in main_loop () at /home/chris/src/conky/src/conky.cc:2407
        time_to_sleep = -1.531293001999984
        seconds = <optimized out>
        nanos = <optimized out>
        req = {tv_sec = -2, tv_nsec = 468706998}
        rem = {tv_sec = 0, tv_nsec = 0}
        terminate = 0
        t = <optimized out>
        inotify_config_wd = -1
        inotify_buff = '\000' <repeats 224 times>...
#10 0x000055555556c3a8 in main () at /home/chris/src/conky/src/conky.cc:3172
        curl_global = <optimized out>

What happens when you comment in the following code:

diff --git a/src/nvidia.cc b/src/nvidia.cc
index 16e76646..e362640d 100644
--- a/src/nvidia.cc
+++ b/src/nvidia.cc
@@ -647,22 +647,22 @@ int set_nvidia_query(struct text_object *obj, const char *arg,

 // Return the amount of targets present or raise error)
 static inline int get_nvidia_target_count(Display *dpy, TARGET_ID tid) {
-  int num_tgts;
-  if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) {
-    num_tgts = -1;
-  }
-
-  if (num_tgts < 1) {
-    // Print error and exit if there's no NVIDIA's GPU
-    CRIT_ERR(nullptr, NULL,
-             "%s:"
-             "\n          Trying to query Nvidia target failed (using the "
-             "propietary drivers)."
-             "\n          Are you sure they are installed correctly and a "
-             "Nvidia GPU is in use?"
-             "\n          (display: %d,Nvidia target_count: %d)",
-             __func__, dpy, num_tgts);
-  }
+  int num_tgts = 1;
+  /* if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) { */
+  /*   num_tgts = -1; */
+  /* } */
+  /* if (num_tgts < 1) { */
+  /*   // Print error and exit if there's no NVIDIA's GPU */
+  /*   CRIT_ERR(nullptr, NULL, */
+  /*            "%s:" */
+  /*            "\n          Trying to query Nvidia target failed (using the " */
+  /*            "propietary drivers)." */
+  /*            "\n          Are you sure they are installed correctly and a " */
+  /*            "Nvidia GPU is in use?" */
+  /*            "\n          (display: %d,Nvidia target_count: %d)", */
+  /*            __func__, dpy, num_tgts); */
+  /* } */

   return num_tgts;
 }

This diff is not good too. Daqfu. I deleted the lines instead.

It worked!!! Not perfect, but it worked!!!!

conky.config = {out_to_console=true,out_to_x=false}
conky.text = [[
    NVIDIA: ${nvidia gputemp}
    NVIDIA: ${nvidia fanspeed}
    NVIDIA: ${nvidia memmax}
    NVIDIA: ${nvidia memfree}
]]
⌂17% 2d [chris:~/src/conky] master(+6/-20)+ ± conky -c ~/Conky/conky_nvidia.conf                                                    
conky: get_nvidia_value: Something went wrong running nvidia query (tid: 1, aid: 0)                                                 
conky: get_nvidia_value: Something went wrong running nvidia query (tid: 5, aid: 13)
conky: cache_nvidia_value: Something went wrong running nvidia query (tid: 1, aid: 11)
conky: get_nvidia_value: Something went wrong running nvidia query (tid: 1, aid: 9)
conky: cache_nvidia_value: Something went wrong running nvidia query (tid: 1, aid: 11)
    NVIDIA: N/A
    NVIDIA: N/A
    NVIDIA: N/A
    NVIDIA: 0

So for some reason the XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts) function call causes a segfault, wow. Can you play around with the variable num_tgts until you get correct result ?

What variables? I tried initial 1, -1, 2, and 0.

Just in the range of -10/10

The int num_tgts; variable.

Can you also try this:

diff --git a/src/nvidia.cc b/src/nvidia.cc
index 16e76646..ba4e3ae0 100644
--- a/src/nvidia.cc
+++ b/src/nvidia.cc
@@ -648,7 +648,7 @@ int set_nvidia_query(struct text_object *obj, const char *arg,
 // Return the amount of targets present or raise error)
 static inline int get_nvidia_target_count(Display *dpy, TARGET_ID tid) {
   int num_tgts;
-  if (!XNVCTRLQueryTargetCount(dpy, translate_nvidia_target[tid], &num_tgts)) {
+  if (!XNVCTRLQueryTargetCount(dpy, NV_CTRL_TARGET_TYPE_GPU, &num_tgts)) {
     num_tgts = -1;
   }
/usr/include/X11/Xlib.h:82: note: it was later defined here
 #define Bool int

In file included from /home/chris/src/conky/src/nvidia.cc:94:
/usr/include/NVCtrl/NVCtrlLib.h:820:5: error: ‘Display’ does not name a type; did you mean ‘DisplayCells’?
     Display *display;
     ^~~~~~~
     DisplayCells
/usr/include/NVCtrl/NVCtrlLib.h:821:5: error: ‘Time’ does not name a type; did you mean ‘True’?
     Time time;
     ^~~~
     True
/usr/include/NVCtrl/NVCtrlLib.h:843:5: error: ‘Bool’ does not name a type
     Bool send_event;  /* always FALSE, we don't allow send_events */
     ^~~~
/usr/include/NVCtrl/NVCtrlLib.h:843:5: note: the macro ‘Bool’ had not yet been defined
In file included from /home/chris/src/conky/src/x11.h:30,
                 from /home/chris/src/conky/src/nvidia.cc:98:
/usr/include/X11/Xlib.h:82: note: it was later defined here
 #define Bool int

In file included from /home/chris/src/conky/src/nvidia.cc:94:
/usr/include/NVCtrl/NVCtrlLib.h:844:5: error: ‘Display’ does not name a type; did you mean ‘DisplayCells’?
     Display *display;
     ^~~~~~~
     DisplayCells
/usr/include/NVCtrl/NVCtrlLib.h:845:5: error: ‘Time’ does not name a type; did you mean ‘True’?
     Time time;
     ^~~~
     True
[ 96%] Building CXX object src/CMakeFiles/conky.dir/apcupsd.cc.o
[ 98%] Building CXX object src/CMakeFiles/conky.dir/nc.cc.o
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_target_count(Display*, TARGET_ID)’:
/home/chris/src/conky/src/nvidia.cc:651:8: error: ‘XNVCTRLQueryTargetCount’ was not declared in this scope
   if (!XNVCTRLQueryTargetCount(dpy, NV_CTRL_TARGET_TYPE_GPU, &num_tgts)) {
        ^~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc: In function ‘int cache_nvidia_value(TARGET_ID, ATTR_ID, Display*, int*, int)’:
/home/chris/src/conky/src/nvidia.cc:676:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope
       if (!dpy || !XNVCTRLQueryTargetAttribute(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc:690:20: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope
       if (!dpy || !XNVCTRLQueryTargetAttribute(
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc: In function ‘int get_nvidia_value(TARGET_ID, ATTR_ID, int)’:
/home/chris/src/conky/src/nvidia.cc:720:10: error: ‘XNVCTRLQueryTargetAttribute’ was not declared in this scope
         !XNVCTRLQueryTargetAttribute(dpy, translate_nvidia_target[tid], gid, 0,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chris/src/conky/src/nvidia.cc: In function ‘char* get_nvidia_string(TARGET_ID, ATTR_ID, int)’:
/home/chris/src/conky/src/nvidia.cc:743:16: error: ‘XNVCTRLQueryTargetStringAttribute’ was not declared in this scope
   if (!dpy || !XNVCTRLQueryTargetStringAttribute(
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/conky.dir/build.make:739: src/CMakeFiles/conky.dir/nvidia.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:218: src/CMakeFiles/conky.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

EDIT: I know what I did wrong. Sorry.

You forgot the perhaps ?

Yup, I reset the file. Compiled okay, but segfaults. Not sure if you need this log.

#4  0x00005555555d51d4 in get_nvidia_target_count (tid=TARGET_GPU, dpy=0x0) at /home/chris/src/conky/src/nvidia.cc:653
        num_tgts = 0
        num_tgts = <optimized out>
        __func__ = "get_nvidia_target_count"
#5  print_nvidia_value(text_object*, char*, int) () at /home/chris/src/conky/src/nvidia.cc:889
        nvs = 0x55555566d4e0
        value = <optimized out>
        temp1 = <optimized out>
        temp2 = <optimized out>
        str = 0x0
        dpy = 0x0
        num_GPU = 0
#6  0x0000555555576483 in generate_text_internal (p=0x55555566d9dc "", p@entry=0x55555566d9d0 "    NVIDIA: ", p_max_size=16372, root=...) at /home/chris/src/conky/src/conky.cc:861
        obj = 0x55555566d450
        a = <optimized out>
#7  0x000055555557914d in generate_text () at /usr/include/c++/8.2.0/bits/unique_ptr.h:342
        i = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        p = 0x55555566d9d0 "    NVIDIA: "
        j = <optimized out>
        time = <optimized out>
        p = <optimized out>
        i = <optimized out>
        j = <optimized out>
        k = <optimized out>
        mw = <optimized out>
        tbs = <optimized out>
        ui = <optimized out>
        time = <optimized out>
        tmp_p = <optimized out>
#8  update_text () at /home/chris/src/conky/src/conky.cc:1981
No locals.
#9  0x000055555557b748 in main_loop () at /home/chris/src/conky/src/conky.cc:2407
        time_to_sleep = -0.89075966399991557
        seconds = <optimized out>
        nanos = <optimized out>
        req = {tv_sec = -1, tv_nsec = 109240336}
        rem = {tv_sec = 0, tv_nsec = 0}
        terminate = 0
        t = <optimized out>
        inotify_config_wd = -1
        inotify_buff = '\000' <repeats 224 times>...

The same function call XNVCTRLQueryTargetCount(dpy, NV_CTRL_TARGET_TYPE_GPU, &num_tgts) is in official nvidia pdf, page 7 - https://www.nvidia.com/docs/IO/40049/TB-Quadro_VideoCaptureStreaming_v01.pdf

Don't know why it causes a segfault, it's perfectly valid call.

lsmod | grep \^n
nvidia

I can open nvidia-settings and such. I don't know why either.

I have all this.

local/conky-nvidia 1.10.8-1
    Lightweight system monitor for X
local/lib32-nvidia-340xx-utils 340.107-3
    NVIDIA drivers utilities (32-bit)
local/lib32-opencl-nvidia-340xx 340.107-3
    OpenCL implemention for NVIDIA (32-bit)
local/libvdpau 1.1.1+3+ga21bf7a-1
    Nvidia VDPAU library
local/libxnvctrl-340xx 340.104-1
    NVIDIA NV-CONTROL X extension, 340xx legacy branch
local/nvidia-340xx-dkms 340.107-18
    NVIDIA driver sources for linux, 340xx legacy branch
local/nvidia-340xx-utils 340.107-3
    NVIDIA drivers utilities
local/nvidia-cg-toolkit 3.1-4
    NVIDIA Cg libraries
local/opencl-nvidia-340xx 340.107-3
    OpenCL implemention for NVIDIA
local/xf86-video-nouveau 1.0.15-3 (xorg-drivers)
    Open Source 2D acceleration driver for nVidia cards

This is also an issue - it all started when a whole host of nvidia cards were turned into legacy cards and we had to use different drivers besides what we were using - thanks to nvidia ...

I am building conky without nvidia support - and nvidia data is derived using LUA and nvidia-smi.

here is the list of drivers I have

local/conky-cairo v1.10.8.r88.g87187ff6-1
    conky - built for nvidia n (tolua++_5.3 in AUR) - See this PKGBUILD source -
    Just change one variable to build the git version - defaults to release
    version.
local/lib32-nvidia-utils 396.45-1
    NVIDIA drivers utilities (32-bit)
local/libvdpau 1.1.1+3+ga21bf7a-1
    Nvidia VDPAU library
local/libxnvctrl 396.45-1
    NVIDIA NV-CONTROL X extension
local/nvidia-390xx 390.77-5
    NVIDIA drivers for linux, 390xx legacy branch
local/nvidia-390xx-utils 390.77-1
    NVIDIA drivers utilities
local/opencl-nvidia 396.45-1
    OpenCL implemention for NVIDIA

@brndnmtthws Can you look at this? If we can't solve this, then we could scrap it all in favor of ${exec} + nvidia_smi queries.

I just got the update from 1.10.8 to 1.11.0 on Arch, and it works. I built from the AUR, which includes a small patch.

Built against libxnvctrl-415.18-1. I see the errors in this thread came with older versions, maybe nvidia fixed it?

Does this config works for you on aur/conky-nvidia?

conky.config = {out_to_console=true,out_to_x=false}
conky.text = [[
    NVIDIA: ${nvidia gputemp 1}
    NVIDIA: ${nvidia fanspeed 1}
    NVIDIA: ${nvidia memmax 1}
    NVIDIA: ${nvidia memfree 1}
]]

I'm on...

$ nvidia-smi --format=csv,noheader,nounits --query-gpu=driver_version
340.107

and I got...

conky: unknown variable '$nvidia'
conky: unknown variable '$nvidia'
conky: unknown variable '$nvidia'
conky: unknown variable '$nvidia'
    NVIDIA: ${nvidia}
    NVIDIA: ${nvidia}
    NVIDIA: ${nvidia}
    NVIDIA: ${nvidia}

The config you provided (outputting to terminal) instantly segfaults, leaving behind this stacktrace in my journal:

systemd-coredump[14067]: Process 14065 (conky) of user 1000 dumped core.

                         Stack trace of thread 14065:
                         #0  0x00007f00e586a21d XQueryExtension (libX11.so.6)
                         #1  0x00007f00e585d997 XInitExtension (libX11.so.6)
                         #2  0x00007f00e562e18f XextAddDisplay (libXext.so.6)
                         #3  0x00007f00e4c3b8fc XNVCTRLQueryTargetCount (libXNVCtrl.so.0)
                         #4  0x00005637941beda8 _Z18print_nvidia_valueP11text_objectPcj (conky)
                         #5  0x0000563794152a13 _Z22generate_text_internalPci11text_object (conky)
                         #6  0x0000563794152ce9 _ZL11update_textv (conky)
                         #7  0x0000563794153567 _ZL9main_loopv (conky)
                         #8  0x0000563794140c26 main (conky)
                         #9  0x00007f00e427f223 __libc_start_main (libc.so.6)
                         #10 0x000056379414508e _start (conky)

If I however change it to output to its own X window, it runs fine, which is why it seemingly worked without issues for me.

% head -n1 conky.conf
conky.config = { out_to_console = false, out_to_x = true, own_window = true }
% conky
conky: desktop window (400039) is subwindow of root window (1e1)
conky: window type - normal
conky: drawing to created window (0x1800001)
conky: can't load font '6x10'
conky: can't load font '6x10'

own_window = false results in this:

% conky
conky: desktop window (400039) is subwindow of root window (1e1)
conky: drawing to desktop window
conky: can't load font '6x10'
conky: can't load font '6x10'
conky: X Error: type 0 Display 55b578307640 XID 4194361 serial 192 error_code 8 request_code 55 minor_code 0 other Display: 55b578307640

zsh: abort (core dumped)  conky
% journalctl -e
systemd-coredump[14512]: Process 14510 (conky) of user 1000 dumped core.

                         Stack trace of thread 14510:
                         #0  0x00007f881c59fd7f raise (libc.so.6)
                         #1  0x00007f881c58a672 abort (libc.so.6)
                         #2  0x0000559ca7f311c5 _ZL17x11_error_handlerP9_XDisplayP11XErrorEvent (conky)
                         #3  0x00007f881db8352a _XError (libX11.so.6)
                         #4  0x00007f881db803f8 n/a (libX11.so.6)
                         #5  0x00007f881db804a5 n/a (libX11.so.6)
                         #6  0x00007f881db81410 _XReply (libX11.so.6)
                         #7  0x00007f881db7728a XQueryExtension (libX11.so.6)
                         #8  0x00007f881db6a997 XInitExtension (libX11.so.6)
                         #9  0x00007f881d72bdba XDamageFindDisplay (libXdamage.so.1)
                         #10 0x00007f881d72c112 XDamageQueryExtension (libXdamage.so.1)
                         #11 0x0000559ca7ed50d7 _Z14initialisationiPPc (conky)
                         #12 0x0000559ca7ec3c17 main (conky)
                         #13 0x00007f881c58c223 __libc_start_main (libc.so.6)
                         #14 0x0000559ca7ec808e _start (conky)

Seeing the different stack trace (not even mentioning anything nvidia), this might be an unrelated issue.

All commands were executed from within the same terminal emulator session under X.

% nvidia-smi --format=csv,noheader,nounits --query-gpu=driver_version
415.18

I forget to use /usr/bin/conky instead of /usr/local/bin/conky, but yes. It crashed here. The /usr/local/bin/conky was built without NVIDIA.

My /usr/bin/conky crashes with likely same errors as yours.

$ /usr/bin/conky -c ~/Documents/Conky/520/nvidia.conf
conky: desktop window (25a) is root window
conky: drawing to desktop window
conky: can't load font '6x10'
conky: can't load font '6x10'
conky: X Error: type 0 Display 55d3cccbbd10 XID 37748741 serial 402 error_code 2 request_code 156 minor_code 2 other Display: 55d3cccbbd10

[1]    19199 abort (core dumped)  /usr/bin/conky -c ~/Documents/Conky/520/nvidia.conf

I require the nvidia patch (from aur) to compile conky with BUILD_NVIDIA, but it still does not work. My nvidia errors are same as yours... so I think nothing changed because I tried in earlier comments to read variables and nothing turns up.

Offtopic. I think conky may have to fix unrelated things that went wrong with 11.0 release too.

If I however change it to output to its own X window, it runs fine, which is why it seemingly worked without issues for me.

@brndnmtthws This is same for me... I can print nvidia variables okay in X, but not console... And I always often test things in the console which is why I never could get this to work in first place (as it would always crash right away). What do you need from me to make this work okay in the console too? :slightly_smiling_face:

EDIT: I can't run nvidia.conf (it crashes), but I can run old nvidia-pre1.10.conf fine.

Crashed.

It took a while to figure out, but I think I have it sorted out with #698. There were a couple issues, but mainly:

  • We weren't correctly handling the case where there are no fans.
  • We weren't properly handling Expose events with XShape.
  • If XDamage wasn't available, it caused a crash.

@brndnmtthws It's better. :+1: I can run a current conky.confg now. Running in console sefaults. Here's the config.

I also get conky: get_nvidia_value: Something went wrong running nvidia query (tid: 1, aid: 2) messages with ${nvidia ambienttemp} (Value = N/A). It's probably fine?

Turn off out_to_x and turn on out_to_console to run console.

conky.config = {
    out_to_console = false,
    out_to_x = true,
    own_window = true,
}

conky.text = [[
${nvidia gputemp} (temp) GPU temperature
${nvidia gputempthreshold} (threshold) Temperature threshold where the GPU will reduce it's clock speed
${nvidia ambienttemp} (ambient) Ambient temperature outside the graphics card
${nvidia gpufreqcur} (gpufreq) Current GPU clock speed
${nvidia gpufreqmin} Minimum GPU clock speed
${nvidia gpufreqmax} Maximum GPU clock speed
${nvidia memfreqcur} (memfreq) Current memory clock speed
${nvidia memfreqmin} Minimum memory clock speed
${nvidia memfreqmax} Maximum memory clock speed
${nvidia mtrfreqcur} (mtrfreq) Current memory transfer rate clock speed
${nvidia mtrfreqmin} Minimum memory transfer rate clock speed
${nvidia mtrfreqmax} Maximum memory transfer rate clock speed
${nvidia perflevelcur} (perflevel) Current performance level
${nvidia perflevelmin} Lowest performance level
${nvidia perflevelmax} Highest performance level
${nvidia perfmode} Performance mode
${nvidia gpuutil} GPU utilization %
${nvidia membwutil} Memory bandwidth utilization %
${nvidia videoutil} Video engine utilization %
${nvidia pcieutil} PCIe bandwidth utilization %
${nvidia memused} (mem) Amount of used memory
${nvidia memfree} (memavail) Amount of free memory
${nvidia memmax} (memtotal) Total amount of memory
${nvidia memutil} (memperc) Memory utilization %
${nvidia fanspeed} Fan speed
${nvidia fanlevel} Fan level %
${nvidia imagequality} Image quality
${nvidia modelname} name of the GPU card
]]

Hmm, perhaps there needs to be a slightly more general solution. Let me have another pass at it.

Just updated again, give it a shot.

 $ conky -c ~/Documents/Conky/520/nvidia.conf
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
conky: print_nvidia_value: no display set (try setting nvidia_display)
 (temp) GPU temperature
 (threshold) Temperature threshold where the GPU will reduce it's clock speed
 (ambient) Ambient temperature outside the graphics card
 (gpufreq) Current GPU clock speed
 (memfreq) Current memory clock speed
 (mtrfreq) Current memory transfer rate clock speed
 (perflevel) Current performance level
 (mem) Amount of used memory
 (memavail) Amount of free memory
 (memtotal) Total amount of memory
 (memperc) Memory utilization %
 (temp) GPU temperature
 (threshold) Temperature threshold where the GPU will reduce it's clock speed
 (ambient) Ambient temperature outside the graphics card
 (gpufreq) Current GPU clock speed
 Minimum GPU clock speed
 Maximum GPU clock speed
 (memfreq) Current memory clock speed
 Minimum memory clock speed
 Maximum memory clock speed
 (mtrfreq) Current memory transfer rate clock speed
 Minimum memory transfer rate clock speed
 Maximum memory transfer rate clock speed
 (perflevel) Current performance level
 Lowest performance level
 Highest performance level
 Performance mode
 GPU utilization %
 Memory bandwidth utilization %
 Video engine utilization %
 PCIe bandwidth utilization %
 (mem) Amount of used memory
 (memavail) Amount of free memory
 (memtotal) Total amount of memory
 (memperc) Memory utilization %
 Fan speed
 Fan level %
 Image quality
 name of the GPU card
$

That's right, unless you set nvidia_display or are outputting to X it won't actually display anything.

Got it with nvidia_display=":0". Everything is printed twice. Almost perfect. :-)

EDIT:
This is apparently caused by having out_to_stderr=true too.
Even if you added a line -------------- in the conky.text, it'll be printed twice with out_to_stderr.

I was under impressed that out_to_stderr would consolidate stderr and stdout messages instead of sending out to both channels. This might goes without saying, but thank you for fixing this. :heart:

Was this page helpful?
0 / 5 - 0 ratings