Friday, January 17, 2014

NVIDIA GPU Temp

On my old TV setup I used nvclock to get the NVIDIA GPU temperature and graph it using rrdtool (along with other temperatures and fan speeds).

nvclock was always a bit of a hack and does not work any more (at least, it won't do anything useful for me).

I know the nvidia-settings tool can display the temperature (and much more information) so there must be a modern way to access this data. A quick google showed up the nvidia-smi tool.

Quick and dirty,
nvidia-smi -q | grep Temperature -A 1
will show the current temperature.
    Temperature
        Gpu                     : 72 C


Interestingly, the output can also be in XML format. Combined with some xslt magic, it is possible to get the temperature in a more structured way.
echo '<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method='text'/>
<xsl:template match="/">
<xsl:for-each select="//gpu_temp">
<xsl:value-of select="."/>

<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

' > nvidia-temp.xml
nvidia-smi --dtd > nvsmi_device_v6.dtd
nvidia-smi -q -x | xsltproc nvidia-temp.xml -

Note: Your driver might be using a different dtd version. Adjust as required. (nvidia-smi --dtd | head -1 | cut -d ' ' -f 2 will give the correct name)

If you have multiple cards and want to know which card has which temperature then you can alter the xsl to format it as you require with something like
<xsl:value-of select="ancestor::gpu/@id"/> or <xsl:value-of select="ancestor::gpu/uuid"/>
eg
0000:04:00.0 Quadro K2000 31 C
0000:05:00.0 Quadro K2000 32 C



11 comments:

  1. The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful
    Bad Ice Cream

    ReplyDelete
  2. I am very happy to read this. Appreciate your sharing lulubox download

    ReplyDelete
  3. I don't understand about NVIDIA GPU Temp. Please at first give a brief introduction about it. And one thing if you need a guidance to install exodus kodi, just ping me.

    ReplyDelete
  4. Thanks for expaling about NVIDIA GPU Temp. Can you tell me how we can resolve high CPU usages issue? and Can I post your blog on QuickBooks support site?

    ReplyDelete
  5. There's no easy answer; it varies from GPU to GPU. Google is your friend. Most modern chips can run at temperatures in the mid-90 degrees Celsius, though, and you'll often see them hit those temperatures in gaming laptops

    hotstar app

    ReplyDelete
  6. NVIDIA should do something to lower the temperature of their chipset while playing games. I have encountered this problem while working on Geek Squad Tech Support project.

    ReplyDelete
  7. This post is discussing in an outstanding way. I like your way yo discussed your valid points and facts about this. I really said you share more and more articles How To Remove Mildew From Clothes

    ReplyDelete
  8. Most of the toxic plants are irritants, causing localized tenderness of the mouth, stomach & skin. The toxic principle in the other plants have a systemic effect, damage the function of cat organs like the heart or kidney. Plants Poisonous To Cats

    ReplyDelete
  9. In Present Scenario, being able to speak English is crucial for both career success and social success. here we learn how to speak confidently and correctly. we provide an excellent training on learning the language with different and excellent methods. English Speaking Course Online

    ReplyDelete
  10. Hey, Excellent work. I must appreciate the way you manage your article’s content and the look & feel of your website. you are really doing a great work, carry on the hard work.
    Best SEO services in Delhi NCR

    ReplyDelete