How to get nvidia-smi working!

Hey there! I’ve already posted in the NVML forum about this, but I’ll post here as well to increase visibility…

The problem with nvidia-smi is actually a bug in NVML, where it incorrectly detects that a graphics card is unsupported, when it actually is. I’ve created a workaround for this, you can find it here:
https://github.com/CFSworks/nvml_fix

To use it, you should be on either the 325.08 or 319.32 drivers. Build the proper version for your driver:
$ make 325.08
Then copy the built library over your libnvidia-ml.so.1:

rm /usr/lib/libnvidia-ml.so.1

cp built/325.08/libnvidia-ml.so.1 /usr/lib

This should fix the bug, and allow nvidia-smi to report all information on your GPU.

Let me know if it works, thanks!

Thanks for this, it works for me.
I get data from the Clocks, Utilization, and Performance State sections now on my GTX 560 Ti and GT 240.

9500GT and 9800GT do work as well :)

Any plans on updating this for 331.20?

I believe the author already did, but only for x64 platforms… look at the latest sources.

Unfortunately not.

CC = gcc
CFLAGS =
TARGET_VER = 325.15# just set to a valid ver eg. one of: 325.08 325.15 319.32 319.23
TARGET_MAJOR := $(shell echo ${TARGET_VER} | cut -d . --f=1)
TARGET = libnvidia-ml.so.1
DESTDIR = /
PREFIX = $(DESTDIR)usr
libdir = $(PREFIX)/lib
INSTALL = /usr/bin/install -D

all: $(TARGET)

${TARGET:1=${TARGET_VER}}: empty.c
        ${CC} ${CFLAGS} -shared -fPIC $(<) -o $(@)

$(TARGET): ${TARGET:1=${TARGET_VER}}
        ${CC} ${CFLAGS} -shared -fPIC -o $(@) -DNVML_PATCH_${TARGET_MAJOR} -DNVML_VERSION=\"$(TARGET_VER)\" $< nvml_fix.c


clean:
        rm -f $(TARGET)
        rm -f ${TARGET:1=${TARGET_VER}}

install: libnvidia-ml.so.1
        $(INSTALL) -Dm755 $(^) $(libdir)/$(^)

.PHONY: clean install all

@Deanjo: It has been fixed in this commit: https://github.com/CFSworks/nvml_fix/commit/429a6dc247aa1df6225156490e02bd34b64c7244

Tried and works for me with 331.20.

meh, and I use a 32 bit Ubuntu for which there is no patch for the 331 drivers

Will you update it for 334.21?

For what it’s worth, the last version that this works for me on x64 is 331.20. Any version higher does not currently work.

Neat tidbit I just noticed… it seems on newer driver revisions (I am on 331.38) nvidia-settings has additional attributes added that display most of the same parameters that nvidia-smi can output with a fully supported GPU, regardless of GPU type.

For example:

This is very useful for anyone that wants to monitor real-time clocks in Linux… you can certainly script whichever variables you wish… For a list of all available parameters:

I believe the only drawback is that an X server needs to be running to access these parameters. (as opposed to nvidia-smi)

For example, here is a quick Linux way to dump the GPU clocks as an infinite loop to a txt file that can be used to average clocks in a spreadsheet after the fact. In my case, I have 3 GPU’s in my system, ergo the ‘gpu:2’ grep. (count starts from 0)