Archiv > Raspberry PI
freien GPURam anzeigen lassen
(1/1)
Torsten73:
Hi,
hier gibt es ein praktisches Script für den Raspi, um den freien Speicher sich anzeigen zu lassen.
http://www.forum-raspberrypi.de/Thread-freien-gpu-ram-anzeigen
wäre doch etwas für das tools paket oder?
das Ergebnis:
--- Code: ---MLD-Raspi> ./gpumem
GPU Memory free: 40MB of total 108MB (normaly total 128MB)
--- End code ---
jetzt das ganze mit systeminfo noch verwurschteln wäre natürlich die Krönung.
allerdings geht das orginalscript nicht so ganz.
Habe es wie folgt geändert:
--- Code: ---#!/bin/sh
TTOTALgpuMEM=$(vcgencmd get_mem gpu | awk -F'=' {'print $2'} | tr -d M)
TOTALgpuMEM=$(vcdbg reloc | grep total | awk {'print $5'} | tr -d M | tr -d ,)
FREEgpuMEM=$(vcdbg reloc | grep free | tail -n1 | awk {'print $3'} | tr -d M)
OFFLINEgpuMEM=$(vcdbg reloc | grep offline | tail -n1 | awk {'print $3'} | tr -d M)
MSG="GPU Memory free: ${FREEgpuMEM}MB"
[ -n "$OFFLINEgpuMEM" ]&&[ "$OFFLINEgpuMEM" != "allocated" ] && MSG="$MSG (${OFFLINEgpuMEM}MB offline)"
MSG="$MSG of total ${TOTALgpuMEM}MB (normaly total ${TTOTALgpuMEM}MB)"
echo $MSG
--- End code ---
das ganze habe ich unter /usr/sbin/gpumem abgelegt
und mit chmod +x /usr/sbin/gpumem
ausführbar gemacht.
Leider wird es nur im gleichen Verzeichniss mit ./gpumem ausgeführt. Ich dachte das müßte nun ohne pfad überall laufen. Nun ich habe es mit scripten nicht so wie ihr merkt ::)
clausmuus:
Danke, hab's mit aufgenommen, im rpi Paket.
Claus
pbriesch:
Hallo Claus,
ich habe hier auch noch ein schönes Skript gefunden:
--- Code: ---#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
}
function calculate_overvolts {
# We can safely ignore the integer
# part of the decimal argument
# since it's not realistic to run the Pi
# at voltages higher than 1.99 V
let overvolts=${1#*.}-20
echo "$overvolts"
}
temp=$(vcgencmd measure_temp)
temp=${temp:5:4}
volts=$(vcgencmd measure_volts)
volts=${volts:5:4}
if [ $volts != "1.20" ]; then
overvolts=$(calculate_overvolts $volts)
fi
minFreq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq)
minFreq=$(convert_to_MHz $minFreq)
maxFreq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq)
maxFreq=$(convert_to_MHz $maxFreq)
freq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
freq=$(convert_to_MHz $freq)
governor=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
echo "Temperature: $temp C"
echo -n "Voltage: $volts V"
[ $overvolts ] && echo " (+0.$overvolts overvolt)" || echo -e "\r"
echo "Min speed: $minFreq MHz"
echo "Max speed: $maxFreq MHz"
echo "Current speed: $freq MHz"
echo "Governor: $governor"
exit 0
--- End code ---
Torsten73:
Ich sehe gerade, dass ich den Libary Pfad oben noch drin hatte, der kann für uns ganz gelöscht werden. Die Libs sind bei der mld auch so verfügbar.
Ich habe es noch mal geändert. Aber funktionieren sollte es auch ohne die Änderung.
Navigation
[0] Message Index
Go to full version