Announcement

Collapse
No announcement yet.

Radeon Vii temps

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Radeon Vii temps

    Is it possible to read the junction temps within Linux on the V7 ?

  • #2
    the junction temps is a new measure method used in radeon vii, so I assume it is the default value you get from:
    /sys/class/drm/card0/device/hwmon/hwmon1/temp1_input

    Comment


    • #3
      Junction temp and GPU dye temp seem to be different , That's why I was enquiring, not sure if the default for lm sensors is reading junction or GPU, I would like to have both ideally

      Comment


      • #4
        Originally posted by pete910 View Post
        Junction temp and GPU dye temp seem to be different , That's why I was enquiring, not sure if the default for lm sensors is reading junction or GPU, I would like to have both ideally
        Check what values you can find from /sys/class/drm/card0/device/hwmon/hwmon1/ and add them to my simple python app:
        Code:
        #!/usr/bin/python
        
        import gi
        gi.require_version('Gtk', '3.0')
        from gi.repository import Gtk, GObject
        
        
        from os import listdir
        from os.path import isdir, isfile, join, realpath, basename
        
        class Node(object):
            __slots__ = ['_path_', '__dict__']
        
            def __init__(self, path='/sys'):
                self._path_ = realpath(path)
                if not self._path_.startswith('/sys/') and not '/sys' == self._path_:
                    raise RuntimeError('Using this on non-sysfs files is dangerous!')
        
                self.__dict__.update(dict.fromkeys(listdir(self._path_)))
        
            def __repr__(self):
                return '<sysfs.Node "%s">' % self._path_
        
            def __str__(self):
                return basename(self._path_)
        
            def __setattr__(self, name, val):
                if name.startswith('_'):
                    return object.__setattr__(self, name, val)
        
                path = realpath(join(self._path_, name))
                if isfile(path):
                    with open(path, 'w') as fp:
                        fp.write(val)
                else:
                    raise RuntimeError('Cannot write to non-files.')
        
            def __getattribute__(self, name):
                if name.startswith('_'):
                    return object.__getattribute__(self, name)
        
                path = realpath(join(self._path_, name))
                if isfile(path):
                    with open(path, 'r') as fp:
                        return fp.read().strip()
                elif isdir(path):
                    return Node(path)
        
            def __setitem__(self, name, val):
                return setattr(self, name, val)
        
            def __getitem__(self, name):
                return getattr(self, name)
        
            def __iter__(self):
                return iter(getattr(self, name) for name in listdir(self._path_))
        
        sysgpu = Node("/sys/class/drm/card0/device/")
        syscpu = Node("/sys/class/hwmon/hwmon0/device/")
        
        class ClockSelectDialog(Gtk.Dialog):
        
            def __init__(self, parent):
                Gtk.Dialog.__init__(self, "Use", parent, 0)
        
                self.set_default_size(150, 100)
        
                vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
                clocklist = sysgpu.pp_dpm_sclk.split("\n")
                for x in clocklist:
                    vbox.add(Gtk.CheckButton(x))        
                box = self.get_content_area()
                box.add(vbox)
                self.show_all()
        
        class MainWindow(Gtk.Window):
            
            def __init__(self):
                Gtk.Window.__init__(self, title="AmdgpuSysfs - Click Engine clock to choose clocks")
                self.box = Gtk.Box(spacing=16)
                self.add(self.box)
                self.cputempbutton=Gtk.Button()
                self.cputemplabel = Gtk.Label("CPU core temp:")
                self.box.pack_start(self.cputemplabel, True, True, 0)
                self.box.pack_start(self.cputempbutton, True, True, 0)
                self.gputempbutton=Gtk.Button()
                self.gputemplabel = Gtk.Label("GPU core temp:")
                self.box.pack_start(self.gputemplabel, True, True, 0)
                self.box.pack_start(self.gputempbutton, True, True, 0)
                self.enginebutton=Gtk.Button()
                self.enginelabel = Gtk.Label("Engine clock:")
                self.box.pack_start(self.enginelabel, True, True, 0)
                self.box.pack_start(self.enginebutton, True, True, 0)
                self.membutton=Gtk.Button()
                self.memlabel = Gtk.Label("Memory clock:")
                self.box.pack_start(self.memlabel, True, True, 0)
                self.box.pack_start(self.membutton, True, True, 0)
                self.selected = False
            
                self.enginebutton.connect("clicked", self.enginebuttonclicked)
        
            def enginebuttonclicked(self, button):
                dialog = ClockSelectDialog(self)
                response = dialog.run()
                y=0
                selectedstr = ""
                
                for x in dialog.get_children()[0].get_children()[0].get_children():
                    value = x.get_active()
                    if value:
                        self.selected = True
                        selectedstr = selectedstr +str(y)+" "
                  
                    y = y +1
                if self.selected:
                     sysgpu.power_dpm_force_performance_level = "manual"
                     sysgpu.pp_dpm_sclk = selectedstr
                     
                dialog.destroy()
            
            def counter(self):      
                self.cputempbutton.set_label(str(int(syscpu.hwmon.hwmon0.temp1_input)/1000) + "C")
                self.gputempbutton.set_label(str(int(sysgpu.hwmon.hwmon1.temp1_input)/1000) + "C")
                self.enginebutton.set_label(sysgpu.pp_dpm_sclk)
                self.membutton.set_label(sysgpu.pp_dpm_mclk)
                return True
        
        win = MainWindow()
        source_id = GObject.timeout_add(2000, win.counter)
        
        win.connect("delete-event", Gtk.main_quit)
        win.show_all()
        Gtk.main() 
        if win.selected:
            sysgpu.power_dpm_force_performance_level = "auto"
          
        GObject.source_remove(source_id)

        Comment


        • #5
          Make no difference as there is only one temp input listed. I had already looked in /sys/class/drm/card0/device/hwmon/hwmon3 to see if there was another .

          Comment


          • #6
            I read that the Junction temp is a new method to measure temperatures and maybe it is the only value that the radeon vii offers.

            Comment


            • #7
              Originally posted by debianxfce View Post
              I read that the Junction temp is a new method to measure temperatures and maybe it is the only value that the radeon vii offers.
              See here, https://legitreviews.com/wp-content/...radeon-vii.jpg

              It offers both on windows via wattman and via hwmon . I'm guessing it's not excisable from within our driver.

              Comment


              • #8
                Originally posted by pete910 View Post
                It offers both on windows via wattman and via hwmon . I'm guessing it's not excisable from within our driver.
                Here is the implementation, figure what it it returns.
                https://elixir.bootlin.com/linux/lat...thermal.c#L216

                https://cgit.freedesktop.org/~agd5f/...-5.2-wip#n2142

                Comment


                • #9
                  Originally posted by debianxfce View Post
                  No way to tell which it uses, only looks for the one output by the looks of it, No my strong point coding though

                  Comment


                  • #10
                    Try this patch set:
                    https://patchwork.freedesktop.org/patch/300538/

                    Comment

                    Working...
                    X