Skip to content

Instantly share code, notes, and snippets.

@srvm
Created April 9, 2015 00:15
Show Gist options
  • Save srvm/0612054d8cec823069bc to your computer and use it in GitHub Desktop.
Save srvm/0612054d8cec823069bc to your computer and use it in GitHub Desktop.
Script to set core and memory frequencies on the NVIDIA Jetson TK1 board.
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Format: set_clocks.sh <core_clock (kHz)> <mem_clock (kHz)>"
exit -1
fi
echo "Supported core clocks:"
cat /sys/kernel/debug/clock/gbus/possible_rates
echo ""
echo "Supported memory clocks:"
cat /sys/kernel/debug/clock/emc/possible_rates
echo ""
echo -n "Current core clock: "
cat /sys/kernel/debug/clock/gbus/rate
echo -n "Current memory clock: "
cat /sys/kernel/debug/clock/emc/rate
echo ""
echo $(($1 * 1000)) > /sys/kernel/debug/clock/override.gbus/rate
echo 1 > /sys/kernel/debug/clock/override.gbus/state
echo -n "New clock rate: "
cat /sys/kernel/debug/clock/gbus/rate
echo $(($2 * 1000)) > /sys/kernel/debug/clock/override.emc/rate
echo 1 > /sys/kernel/debug/clock/override.emc/state
echo -n "New memory clock rate: "
cat /sys/kernel/debug/clock/emc/rate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment