Announcement

Collapse
No announcement yet.

radeon-profile: tool for changing profiles and monitoring some GPU parameters

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

  • #41
    Originally posted by marazmista View Post
    Uhh... I don't know how app will react if there are multi GPU in system
    For my system, I have to use DRI_PRIME=1 as root to read the second card, but a quick grep through the files shows:
    Code:
    $ grep 'sys/class' *
    radeon_profile.cpp:    powerMethodFilePath = "/sys/class/drm/card0/device/power_method",
    radeon_profile.cpp:    profilePath = "/sys/class/drm/card0/device/power_profile",
    radeon_profile.cpp:    dpmStateFilePath = "/sys/class/drm/card0/device/power_dpm_state",
    radeon_profile.cpp:    forcePowerLevelFilePath = "/sys/class/drm/card0/device/power_dpm_force_performance_level",
    Your app is reading only the 1st card.

    You could get the driver which is being using by the cards this way:
    Code:
    $ grep DRIVER /sys/class/drm/card?/device/uevent 
    /sys/class/drm/card0/device/uevent:DRIVER=radeon
    /sys/class/drm/card1/device/uevent:DRIVER=radeon
    $ grep DRIVER /sys/class/drm/card?/device/uevent | cut -d= -f2
    radeon
    radeon
    although I'm not a programmer or a linux dev at all, so I don't know if it's a general, long term solution...

    Comment


    • #42
      Originally posted by gradinaruvasile View Post
      What does "high" mean for you?

      I use glamor (everything from git - kernel, drm,mesa,glamor, libclc, llvm, clang on Debian Testing 64 bit) with r600 on 7560D (Trinity/ARUBA) and on top of it i also use compton - initially because without it i cant see most of my tray icons without compositing on xfce but it grew on me with its subtle effects like fading and sligh shadows (doesnt seem to interfere with 3d or uvd speed or vsync).
      Using radeontop i see that the graphics pipe reaches even 15% if i drag around windows like crazy (its pretty much the same with or without compton) but nothing more. Maybe you were thinking os something else when said "2D tasks"?
      I'm using a HD 6950 also with glamor. But not with everything from git and without LLVM in the mix (LLVM seems to have some issues with cayman). I'm also using xfce, but with its build-in compositor. Now when I look into radeon-profile and monitor the GPU clock it's low when I drag around windows like crazy (3d stuff cause of compositing) but when I scroll in firefox or thunar or even when I just return thunar from minimize the GPU clock speed rises to its maximum. Now I think (correct me if I'm wrong) that both, firefox and thunar, use 2D paths for their internal rendering.

      marazmista I looked at the codes and while this is the first time I looked at C++ codes I think I understand them. I would love to try to hack them around a bit and see what I could archive (ofc. sending everything good upstream to you) but as said before: This is the first time I'm looking at C++ codes. Do you have any recommendation for a good IDE and maybe some documentation for that IDE, too (like: How to import your files) ?

      Comment


      • #43
        Originally posted by TAXI View Post
        when I scroll in firefox or thunar or even when I just return thunar from minimize the GPU clock speed rises to its maximum.
        A bit more information: I just changed the GTK theme and now things are different: Scrolling in firefox brings the GPU clock to it's middle clock speed now and loading a web-page stays at minimum (max before, so it's better) but thunar is still the same.

        I really wonder what things are going on here but it definitely costs energy (and as such money).

        Comment


        • #44
          Thanks ChrisXY and asdfblah for yours posts which gave me an idea how to impelment multi gpu! It is initial (probably graphs will be buggy), but maybe will work. Also I updated temperature readings. If there is a hwmon device for card(which I think is when card is connected though PCI), app try to read temps from sysfs, so there is no need for lm_sensors.

          Originally posted by TAXI View Post
          marazmista I looked at the codes and while this is the first time I looked at C++ codes I think I understand them. I would love to try to hack them around a bit and see what I could archive (ofc. sending everything good upstream to you) but as said before: This is the first time I'm looking at C++ codes. Do you have any recommendation for a good IDE and maybe some documentation for that IDE, too (like: How to import your files) ?
          Glad you understand it, I try write self-documented code. I use QtCreator, I think this is best choice for write programs in Qt framework in C++. To open this project just install QtCreator, gcc, gdb, clone git repo from github and open 'radeon-profile.pro' in IDE. It will ask where build the binary.
          In IDE options select to use Qt4, and build using qmake-qt4, not Qt5 which I think it is now default.
          Qt documentation: https://qt-project.org/doc/qt-5.1/qtdoc/classes.html

          Originally posted by TAXI View Post
          A bit more information: I just changed the GTK theme and now things are different: Scrolling in firefox brings the GPU clock to it's middle clock speed now and loading a web-page stays at minimum (max before, so it's better) but thunar is still the same.

          I really wonder what things are going on here but it definitely costs energy (and as such money).
          Have you tried to force power level to low?

          Comment


          • #45
            Originally posted by marazmista View Post
            I though that this is too simple app
            Right now it might look to you like that, but in my eyes this could become some kind of better catalyst control center for the FOSS driver. The more I think about it the more features come to my mind (including drirc but with a better GUI, for example). Just imagine what happens when this has everything a radeon user needs and the FOSS driver overtakes catalyst...

            Originally posted by marazmista View Post
            Glad you understand it, I try write self-documented code. I use QtCreator, I think this is best choice for write programs in Qt framework in C++. To open this project just install QtCreator, gcc, gdb, clone git repo from github and open 'radeon-profile.pro' in IDE. It will ask where build the binary.
            Thanks! Will have a look into it either later or tomorrow.

            Originally posted by marazmista View Post
            Have you tried to force power level to low?
            This could work, but as a gamer I don't want to do that. The thing is that I don't see why 2D operations need that much GPU speed. But I think this is a bit off-topic and I don't want to derail this thread.

            Comment


            • #46
              Originally posted by marazmista View Post
              Thanks ChrisXY and asdfblah for yours posts which gave me an idea how to impelment multi gpu! It is initial (probably graphs will be buggy), but maybe will work. Also I updated temperature readings. If there is a hwmon device for card(which I think is when card is connected though PCI), app try to read temps from sysfs, so there is no need for lm_sensors.
              Ok, I have looked a little bit at the code, but as I see it your gpu detection is still botched.


              All in radeon_profile.cpp:
              In radeon_profile::detectCards() you figure out all the */cardX/* paths and put them in an array.
              But what you actually write in the combobox is "cardY" where Y is the index in that array. What you should write in that combobox is the X from */cardX/* (either that, or you do it more differently)

              Because in radeon_profile::figureOutGPUDataPaths() you use ui->combo_gpus->currentIndex() to get a gpuIndex that you insert into the paths like "/sys/class/drm/card"+gpuIndex+"/device/power_method". But what you are getting now is the index of the selected element in the combobox.

              That may have a chance of working with two radeon cards, but remember that you only put cards with DRIVER=radeon at the first place in the combobox. My card0 is actually an intel gpu and is not put in the combobox. My card1 is radeon, which is put into the combobox, but being the only element in the combobox it has index 0.

              My c++ isn't very strong and I didn't want to spend too much time at it for now, so I just hardcoded QString gpuIndex = "1" in radeon_profile::figureOutGPUDataPaths().

              It at least does show something in the GPU data text window but the whole gui is very sluggish and "hangy" and the content vanishes for seconds before being refreshed. Maybe you need to put some stuff for reading the values from the kernel in another thread.

              Comment


              • #47
                Stuff like that... with length-1 it will obviously only work for single digit number of cards. Well.
                Code:
                diff --git a/radeon-profile/radeon_profile.cpp b/radeon-profile/radeon_profile.cpp
                index dcc0408..9ec8430 100644
                --- a/radeon-profile/radeon_profile.cpp
                +++ b/radeon-profile/radeon_profile.cpp
                @@ -151,6 +151,13 @@ void radeon_profile::timerEvent() {
                 // === Run commands to read sysinfo
                 QStringList radeon_profile::grabSystemInfo(const QString cmd) {
                     QProcess *p = new QProcess();
                +
                +    //TODO
                +    // is empty string when it is first called with ls /sys/class etc., but doesn't matter, later it's correct
                +    QString gpuIndex = QString(ui->combo_gpus->currentText()); // is this even the correct number to use?
                +    // doesn't seem to work anyway
                +    p->processEnvironment().insert("DRI_PRIME", gpuIndex);
                +
                     p->setProcessChannelMode(QProcess::MergedChannels);
                 
                     p->start(cmd,QIODevice::ReadOnly);
                @@ -270,13 +277,13 @@ void radeon_profile::detectCards() {
                         QFile f("/sys/class/drm/"+out[i]+"/device/uevent");
                         if (f.open(QIODevice::ReadOnly)) {
                             if (f.readLine(50).contains("DRIVER=radeon"))
                -                ui->combo_gpus->addItem("card"+QString().setNum(i));
                +                ui->combo_gpus->addItem(QString(out[i][out[i].length()-1]));
                         }
                     }
                 }
                 
                 void radeon_profile::figureOutGPUDataPaths() {
                -    QString gpuIndex = QString().setNum(ui->combo_gpus->currentIndex());
                +    QString gpuIndex = QString(ui->combo_gpus->itemText(0)); //initially, use first card in list
                 
                     powerMethodFilePath = "/sys/class/drm/card"+gpuIndex+"/device/power_method",
                     profilePath = "/sys/class/drm/card"+gpuIndex+"/device/power_profile",

                Comment


                • #48
                  Originally posted by TAXI View Post
                  I'm using a HD 6950 also with glamor. But not with everything from git and without LLVM in the mix (LLVM seems to have some issues with cayman). I'm also using xfce, but with its build-in compositor. Now when I look into radeon-profile and monitor the GPU clock it's low when I drag around windows like crazy (3d stuff cause of compositing) but when I scroll in firefox or thunar or even when I just return thunar from minimize the GPU clock speed rises to its maximum. Now I think (correct me if I'm wrong) that both, firefox and thunar, use 2D paths for their internal rendering.
                  I use the clearlooks-phenix theme (mainly because it supports both gtk2 and 3). Thunar scrolling is fine, scrolling in Seamonkey (uses the Firefox engine) on pages like www.realitatea.net (full of pictures and quite heavy) initially i have a jump for a second or so (i have 2 sec polling) to the middle level but then its back to normal no matter how i scroll the page.
                  Maybe it has to do with texture loading or something.
                  Also - glamor uses opengl to render everything - it converts plain 2d to opengl textures - so it does use the gpu regardless of the applications that are displayed.
                  - I have the compton compositor running that uses glx as backend. It doesnt cause tearing when moving windows around, playback nor in 3d games (may be somewhat lower framerates, but nothing very visible).
                  - The xfce software compositing is software only and uses more cpu (before being rendered to opengl by glamor it does its stuff exclusively via cpu processing) + introduces tearing in 3d opengl apps and sometimes in video playback too.
                  - i have llvm compiled but i have R600_LLVM=0 in the /etc/environment file so it should be disabled (although some apps seem to still use it unless i explicitly tell them R600_LLVM=0). Anyway, with llvm disabled certain games run better, even webgl rendering is better. I compiled it mainly because its needed for opencl and because the challenge.

                  Comment


                  • #49
                    Just a suggestion: use radeontop's dump mode instead of reimplementing the code.

                    popen("radeontop -d -", "r") to open a pipe, then update your graph when a new line of info comes in.

                    Comment


                    • #50
                      Originally posted by ChrisXY View Post
                      Ok, I have looked a little bit at the code, but as I see it your gpu detection is still botched.


                      All in radeon_profile.cpp:
                      In radeon_profile::detectCards() you figure out all the */cardX/* paths and put them in an array.
                      But what you actually write in the combobox is "cardY" where Y is the index in that array. What you should write in that combobox is the X from */cardX/* (either that, or you do it more differently)

                      Because in radeon_profile::figureOutGPUDataPaths() you use ui->combo_gpus->currentIndex() to get a gpuIndex that you insert into the paths like "/sys/class/drm/card"+gpuIndex+"/device/power_method". But what you are getting now is the index of the selected element in the combobox.

                      That may have a chance of working with two radeon cards, but remember that you only put cards with DRIVER=radeon at the first place in the combobox. My card0 is actually an intel gpu and is not put in the combobox. My card1 is radeon, which is put into the combobox, but being the only element in the combobox it has index 0.

                      My c++ isn't very strong and I didn't want to spend too much time at it for now, so I just hardcoded QString gpuIndex = "1" in radeon_profile::figureOutGPUDataPaths().

                      It at least does show something in the GPU data text window but the whole gui is very sluggish and "hangy" and the content vanishes for seconds before being refreshed. Maybe you need to put some stuff for reading the values from the kernel in another thread.
                      Thanks, on my computer I always see "card0" so this mislead me, I realized that this morning.
                      I pushed some changes to detect card correctly, but the lag is unresolved for now.

                      Originally posted by curaga View Post
                      Just a suggestion: use radeontop's dump mode instead of reimplementing the code.

                      popen("radeontop -d -", "r") to open a pipe, then update your graph when a new line of info comes in.
                      Yea, I think it will be implemented this way, thanks for suggestion.

                      Comment

                      Working...
                      X