1

My problem is, that in Ubuntu 14.10 the old ${nvidia temp} code is not working, I use this code instead: ${execi 60 nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'} °C But this code shows the temperature twice, why could that be?

Here's a screenshot

The output of nvidia-settings -q gpucoretemp:

slaci@slaci-comp:~$ nvidia-settings -q gpucoretemp

  Attribute 'GPUCoreTemp' (slaci-comp:0.0): 63.
    'GPUCoreTemp' is an integer attribute.
    'GPUCoreTemp' is a read-only attribute.
    'GPUCoreTemp' can use the following target types: X Screen, GPU.
  Attribute 'GPUCoreTemp' (slaci-comp:0[gpu:0]): 63.
    'GPUCoreTemp' is an integer attribute.
    'GPUCoreTemp' is a read-only attribute.
    'GPUCoreTemp' can use the following target types: X Screen, GPU.

1 Answer 1

1

Try your code/shell script in a terminal to see exactly what it will output. It's probably supplying the double results, then you can troubleshoot it in a terminal.

nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'

Just saw your updated Q, with the output from nvidia-settings it's printing the temperature twice for some reason. One of them contains "gpu" which is easy to grab with a grep to then pipe only one temp into your perl script, so this should work

nvidia-settings -query GPUCoreTemp| grep gpu | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'

And if it all gets put together into the conkyrc it should look like this:

${execi 60 nvidia-settings -query GPUCoreTemp| grep gpu | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'} °C

Conky should only print what the shell returns to it, and testing exec codes in a terminal is more enlightening than running through Conky, can see error messages that Conky ignores (I think it only uses stdout).

I don't have nvidia-settings so I can't test it, but here are some alternative scripts / commands that should return the GPU's temp; you'll have to look at the output of nvidia-settings to determine what to search for & cut, if it's changed & these don't work anymore.

From 1st forum find

  • nvidia-settings -q gpucoretemp -t
  • nvidia-smi -a | grep Gpu
  • nvclock -T

From 2nd forum find

  • nvidia-settings -q gpucoretemp |grep '):' | cut -d ' ' -f 6,6 | sed -e 's/.\{1\}$//'
  • nvidia-settings -t -q localhost:0/gpucoretemp
6
  • None of these worked for me, except the 1st one from the 2nd forum that gives me the temperature twice again. My Ubuntu is also freshly installed, so there shouldn't be any junk that causes such an error. Thanks anyway.
    – Slaci
    Dec 21, 2014 at 15:29
  • @SomogyiLászló try and run nvidia-settings -q gpucoretemp alone in a terminal, and paste that into your question (edit). Then you can see what's going on & customize the rest to work
    – Xen2050
    Dec 21, 2014 at 15:53
  • @SomogyiLászló Also I think there was a formatting mixup in the 2nd forum (1st line) code that you tried, might be working better now. Or if not you can try deleting everything after & including the last | ("pipe" character) to see what cut returns, and try deleting after the next last | to see what grep returns, back to just the nvidia... part, to split it up & see what's going on
    – Xen2050
    Dec 21, 2014 at 16:02
  • The 1st code from the 2nd forum now gives me the temerature once, but everything after that code disappeared from the running conky, including the "°C".
    – Slaci
    Dec 23, 2014 at 17:16
  • @Slaci Just saw your output from nvidia-settings too, it outputs the temperature twice for some reason. The second time it contains "gpu" which is easy to grab with agrep and then pipe just the one temp into your perl code, so adding that should make your original code work. I'll update my answer with it, hopefully it will work & you can mark it the correct / check-marked answer :)
    – Xen2050
    Dec 23, 2014 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .