I think this gkrellm Plugin making using of NVML (I guess it's just using libnvida-ml, but I didn't check this) is the right approach here.