jxai / lean-conky-config

Lean Conky config that just works
MIT License
121 stars 30 forks source link

Nvidia GPU not showing in panel #20

Closed OldLorekeeper closed 2 weeks ago

OldLorekeeper commented 11 months ago

I can't get Nvidia GPU to display, even with pynvml installed.

I've verified that pynvml is working by running py3smi in my terminal and the GPU printout is working. Conky was also compiled with Nvidia support (conky-lua-nv 1.19.4-1 installed from AUR).

OldLorekeeper commented 11 months ago
conky 1.19.4_pre compiled 2023-10-11 for Linux x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

 General:
  * math
  * hddtemp
  * portmon
  * IPv6
  * Curl
  * RSS
  * wireless
  * support for IBM/Lenovo notebooks
  * nvidia
  * builtin default configuration
  * old configuration syntax
  * Imlib2
  * OSS mixer support
  * apcupsd
  * iostats
  * ncurses
  * Internationalization support
  * PulseAudio

 Lua bindings:
  * Cairo
  * Imlib2
  * RSVG
 X11:
  * Xdamage extension
  * Xinerama extension (virtual display)
  * Xshape extension (click through)
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual
  * Own window
  * Mouse evenets

 Music detection:
  * CMUS
  * MPD
  * MOC

 Default values:
  * Netdevice: eno1
  * Local configfile: $HOME/.conkyrc
  * Localedir: /usr/share/locale
  * Maximum netdevices: 256
  * Maximum text size: 16384
  * Size text buffer: 256
yuan9jie commented 10 months ago

Add ”pip install pynvml” directly. Take care of your python environment.

Strykar commented 8 months ago

Same issue, pynvml is installed.

Goo6i commented 6 months ago

I have the same issue as well. Launching conky using the script shows no error whatsoever. However when I try to launch conky from the terminal it does show an error conky: llua_do_call: function conky_nvidia execution failed: ~/.config/conky/lib/components/gpu.lua:36: attempt to compare number with nil Here's a screenshot of the terminal:

image

And here's a screenshot of conky:

image

I'm using AwesomeWM on arch 6.8.2 and have already installed pynvml system-wide as well as having made a venv just to make sure everything works.

I would've helped fix this issue myself and made a pull request but I know nothing lua related. maybe I should learn that soon.

anyway thank you for your work and I hope you could maybe guide us through working around this issue.

EDIT: i've given up and decided to modify the relevant code and remove everything related to pynvml and just stick with the integration provided by conky. honestly it shows enough info for me. Utilization, fan, temps, and memory are all I need to see.

jxai commented 3 weeks ago

@OldLorekeeper What do you have while running:


/path/to/lcc/lib/components/gpu_nvml
bonswouar commented 3 weeks ago

@jxai Personally when I run gpu_nvml I get:

{
{
model_name='NVIDIA GeForce GTX 970',
mem_used=570818560,
mem_total=4294967296,
mem_free=3724148736,
gpu_util=3,
mem_util=3,
fan_speed=0,
gpu_temp=49,
Traceback (most recent call last):
  File "/home/bonswouar/.config/conky/lean-conky-config/./lib/components/gpu_nvml", line 79, in <module>
    qp(
  File "/home/bonswouar/.config/conky/lean-conky-config/./lib/components/gpu_nvml", line 64, in qp
    return query_and_print(name, f, handle, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bonswouar/.config/conky/lean-conky-config/./lib/components/gpu_nvml", line 46, in query_and_print
    val = query(f, *args, **kw)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/bonswouar/.config/conky/lean-conky-config/./lib/components/gpu_nvml", line 40, in query
    retval = f(*args, **kw)
             ^^^^^^^^^^^^^^
  File "/home/bonswouar/.local/lib/python3.11/site-packages/pynvml/nvml.py", line 2334, in nvmlDeviceGetTemperatureThreshold
    _nvmlCheckReturn(ret)
  File "/home/bonswouar/.local/lib/python3.11/site-packages/pynvml/nvml.py", line 833, in _nvmlCheckReturn
    raise NVMLError(ret)
pynvml.nvml.NVMLError_NotSupported: Not Supported

It seems querying nvmlDeviceGetTemperatureThreshold doesn't work for some reason.

As a workaround I've replaced it with gpu_temp_thres=100, manually

And after uncommenting gpu.nvidia panel in conf, GPU is correctly shown

jxai commented 2 weeks ago

@bonswouar Should be fixed, no need to manually specify the fallback value now. Please give it a try.