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

  • #31
    Originally posted by marazmista View Post
    If it does, that means the debugfs is mounted under proper location, but "none is already mounted on /var/lib/ntp/proc" bothers me.
    For several filesystems, there is no block device; some of these are tmpfs, ramfs, debugfs, sysfs, procfs, cgroup, and cpuset.
    For a full list, see:
    Code:
    grep ^nodev /proc/filesystems
    Anyhow, the mount() syscall has the prototype
    Code:
           int mount(const char *source, const char *target,
                     const char *filesystemtype, unsigned long mountflags,
                     const void *data);
    So for compatability reasons, there has to be a source passed to mount(); this is achieved by passing a nonsense string to the mount command.
    A number of distros just pass "none" for all the nodev filesystems.
    I prefer to use a name based on the path or filesystem (for example: mount -t sysfs sysfs /sys; mount -t devpts devpts /dev/pts), since it avoids the "none is already mounted on..." nonsense.

    Comment


    • #32
      Thanks for this tip. I was afraid that many filesystems mounted as 'none' will cause some troubles or even I could not mount another filesystem (debugfs for instance) if there is something else mounted as 'none'.

      Comment


      • #33
        Originally posted by tiredoffglrx View Post
        That must have been it (I am still running Ubuntu 12.04, after all). Thank you! Everything is working perfectly fine now.

        I am not very skilled in bash but - FWIW - here's the script I am using to start radeon-profile as root:

        Code:
        #!/bin/bash
        
        # radeon-profile.sh
        # Place this in the same folder like radeon-profile
        
        ######## Check if script has Root privileges ########
        
        if [ "$(whoami)" != "root" ]; then
          echo "Not root. Restarting"
          pkexec --user root "$0"
          exit
        fi
        
        ####### Set environment variables required for Root ###########
        
        getXuser() {
                user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
                if [ x"$user" = x"" ]; then
                        startx=`pgrep -n startx`
                        if [ x"$startx" != x"" ]; then
                                user=`ps -o user --no-headers $startx`
                        fi
                fi
                if [ x"$user" = x"" ]; then
                       user=$(pinky -fw | awk '{ print $1; exit; }')
                fi
                if [ x"$user" != x"" ]; then
                        userhome=`getent passwd $user | cut -d: -f6`
                        export XAUTHORITY=$userhome/.Xauthority
                else
                        export XAUTHORITY=""
                fi
                export XUSER=$user
        }
        
        
        for x in /tmp/.X11-unix/*; do
           displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
           getXuser;
              if [ x"$XAUTHORITY" != x"" ]; then
                export DISPLAY=":$displaynum"
              fi
        done
        
        DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
        
        cd "$DIR"
        
        ./radeon-profile
        The only problem I have is that the app won't use my GTK theme when executed as root and falls back to a more "classic" view. Other QT applications work fine under root privileges.
        That's an awful lot of scripting just to get root. You could just do something simpler like:

        Code:
        ## Compile
        git clone https://github.com/marazmista/radeon-profile
        cd radeon-profile/radeon-profile
        qmake-qt4
        make
        ## Install
        sudo chmod +x radeon-profile
        sudo mv radeon-profile /usr/local/sbin/radeon-profile.bin
        sudo sh -c "echo 'gksudo /usr/local/sbin/radeon-profile.bin' > /usr/local/sbin/radeon-profile"
        sudo chmod +x /usr/local/sbin/radeon-profile
        ## Cleanup
        cd ../../
        rm radeon-profile -R
        Then you can just run radeon-profile from anywhere and it'll launch fine with root rights. If you don't have root rights, gksudo will ask for the password to gain root rights.

        Comment


        • #34
          It seems the preferred Ubuntu method of running programs as root is pkexec instead of gksudo as of Ubuntu 13.04

          Code:
          #!/bin/bash
          ## Compile
          git clone https://github.com/marazmista/radeon-profile
          cd radeon-profile/radeon-profile
          qmake-qt4
          make
          ## Install
          sudo chmod +x radeon-profile
          sudo mv radeon-profile /usr/local/sbin/radeon-profile.bin
          sudo sh -c "echo 'pkexec /usr/local/sbin/radeon-profile.bin' > /usr/local/sbin/radeon-profile"
          sudo chmod +x /usr/local/sbin/radeon-profile
          ## Cleanup
          cd ../../
          rm radeon-profile -R

          Comment


          • #35
            Originally posted by mmstick View Post
            It seems the preferred Ubuntu method of running programs as root is pkexec instead of gksudo as of Ubuntu 13.04

            Code:
            #!/bin/bash
            ## Compile
            git clone https://github.com/marazmista/radeon-profile
            cd radeon-profile/radeon-profile
            qmake-qt4
            make
            ## Install
            sudo chmod +x radeon-profile
            sudo mv radeon-profile /usr/local/sbin/radeon-profile.bin
            sudo sh -c "echo 'pkexec /usr/local/sbin/radeon-profile.bin' > /usr/local/sbin/radeon-profile"
            sudo chmod +x /usr/local/sbin/radeon-profile
            ## Cleanup
            cd ../../
            rm radeon-profile -R
            But with this you get
            Code:
            radeon-profile.bin: cannot connect to X server
            So what tiredoffglrx did was right. Of course when there's just one X server running you could simplify it:
            Code:
            #!/bin/sh
            
            if [ "$(whoami)" != "root" ]; then
              pkexec --user root "$0"
              exit
            fi
            
            if [ x"$DISPLAY" == x"" ]; then
              export DISPLAY=":0"
            fi
            
            /usr/local/sbin/radeon-profile.bin
            Also the script would fit better into /usr/local/bin (while the radeon-profile.bin is good at sbin) so every user has it in his PATH.

            Comment


            • #36
              Arrgh, now I forget what I really wanted to say.

              marazmista this is a really handy tool. Used it to confirm that VDPAU with UVD is really working and saw some weird things (high GPU load for 2D tasks, for example¹). Keep up the great work!

              Some feature requests:
              • A configuration tab (refresh frequency, minimize to systray or taskbar, minimize to systray on [x], ...)
              • Better GLX info (currently it shows a weird mixup of the core and the base profile (what will we see when there's a 3.2 core profile, too?)).
              • (If not already there, untested) support for multiple GPUs.
              • A Gentoo ebuild (anyone here who wants to write/maintain one?).
              • A .desktop file for the menu.
              • (If possible, damn root rights...) a .desktop file for autostart.
              • Implement functionality like radeontop (yes, I know, you're working on it. Just a reminder... Maybe change your license to GPLv3 for direct code copy and/or short-circuit with curaga?).



              ¹ Can anybody confirm this (I'm using glamor) ?

              Comment


              • #37
                Originally posted by TAXI View Post
                But with this you get
                Code:
                radeon-profile.bin: cannot connect to X server
                So what tiredoffglrx did was right. Of course when there's just one X server running you could simplify it:
                Code:
                #!/bin/sh
                
                if [ "$(whoami)" != "root" ]; then
                  pkexec --user root "$0"
                  exit
                fi
                
                if [ x"$DISPLAY" == x"" ]; then
                  export DISPLAY=":0"
                fi
                
                /usr/local/sbin/radeon-profile.bin
                Also the script would fit better into /usr/local/bin (while the radeon-profile.bin is good at sbin) so every user has it in his PATH.
                Seems it only spits out that error if you use pkexec instead of gksudo

                Comment


                • #38
                  Originally posted by TAXI View Post

                  high GPU load for 2D tasks, for example¹

                  ¹ Can anybody confirm this (I'm using glamor) ?
                  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"?

                  Comment


                  • #39
                    I was just about bump the topic, but I saw new posts. I was working on code for some time, to get rid of temporary files (stupid, unnecessary io operations). I hope I didn't broke anything (tested on my machines and it was ok).
                    Anyway, thanks for the kind words.

                    Originally posted by TAXI View Post
                    A configuration tab (refresh frequency, minimize to systray or taskbar, minimize to systray on [x], ...)
                    Ok, will do. I though that this is too simple app to write configuration but no problem.
                    Originally posted by TAXI View Post
                    Better GLX info (currently it shows a weird mixup of the core and the base profile (what will we see when there's a 3.2 core profile, too?)).
                    Yes, I modified it in latest version (20131204). Now it shows something like 'glxinfo | grep OpenGL' without any filters.
                    Originally posted by TAXI View Post
                    (If not already there, untested) support for multiple GPUs.
                    Uhh... I don't know how app will react if there are multi GPU in system
                    Originally posted by TAXI View Post
                    A Gentoo ebuild (anyone here who wants to write/maintain one?).
                    .deb package would be nice too
                    Originally posted by TAXI View Post
                    A .desktop file for the menu.
                    Ok, i will look into .desktop files

                    I think I will add some monitor information (card connectors and resolution) and maybe some info from dmesg.

                    Comment


                    • #40
                      What about intel/amd hybrid?

                      Starting with DRI_PRIME=1 sudo -E radeon-profile it still shows the intel gpu from lspci "VGA", but radeon/radeonsi driver information in "GLX info" and in "GPU data" it only shows "Can't read data".

                      Haven't looked at the code, but there is

                      /sys/class/drm/card0/device/ for intel and
                      /sys/class/drm/card1/device/ for amd and I think sometimes they can switch places when rebooting.

                      Comment

                      Working...
                      X