kernel_adiutor icon indicating copy to clipboard operation
kernel_adiutor copied to clipboard

GPU voltage control

Open spezi77 opened this issue 9 years ago • 5 comments

This feature is currently only supported by Synapse. Would be nice to have it in KA-mod as well.

see: https://github.com/apbaxel/UKM/blob/UKM-Enhanced/data/UKM/config.json.generate.gpu

spezi77 avatar Jul 16 '16 09:07 spezi77

Looks like the only part of that which is pertinent is:

            `if [ -f "/sys/devices/system/cpu/cpu0/cpufreq/gpu_mv_table" ]; then
                $BB echo '{ SPane:{
                    title:"GPU Voltages"
                }},'
                    while read UVOLT UNIT; do
                    VOLTAGE=$(($VOLTAGE+1));
                        $BB echo '{ SSeekBar:{
                            default:'$UVOLT',
                            title:"Voltage '${VOLTAGE}'",
                            action:"voltage gpuvolt '${VOLTAGE}'",
                            unit:"' ${UNIT}'",'
                            if [ "$UVOLT" -ge "900000" ]; then
                                $BB echo 'min:900000, max:1200000, step:5000 }},'
                            else
                                $BB echo 'min:900, max:1200, step:5 }},'
                            fi;
                    done < /sys/devices/system/cpu/cpu0/cpufreq/gpu_mv_table
            fi`

I'll see if I can't add it. Though, I'm not entirely sure exactly how I'm going to get it going reliably for all devices.

Also, I don't even know of any kernels that actually use this... and I'd also need an example of the sysfs node that this references.

JoeSchubert avatar Jul 29 '16 22:07 JoeSchubert

Sorry for my late reply. I can provide an example of the sysfs node until the weekend. I have merged 'GPU voltage control' into my 'Revival kernel' for mako. ;)

Basically it is a nice addition for Snapdragon/adreno based devices with custom kernel. There are a few custom kernels out there with this feature, but I can't remember exactly which ones.

spezi77 avatar Aug 01 '16 17:08 spezi77

No worries. If you can provide the examples, I'll try to add it.

JoeSchubert avatar Aug 01 '16 17:08 JoeSchubert

When I make an ouput of the sysfs node I get a vector with these defaults: shell@:/ $ cat /sys/devices/system/cpu/cpu0/cpufreq/gpu_mv_table 945 mV 1050 mV 1150 mV

Do you need the max and min values, as well? I need to look into the source code to figure out..

spezi77 avatar Aug 21 '16 15:08 spezi77

Here we go. I couldn't find where they define the steps. So I assume that it can be defined as we need it (e.g.: 5mV).

#define GPU_MIN_VDD 900 #define GPU_MAX_VDD 1200

https://github.com/spezi77/hellspawn-N4/commit/cb1e9e4782c4a7890ae4149310f7e2ce12088601

spezi77 avatar Aug 21 '16 15:08 spezi77