Enhance run_optimized_192cores.sh to check for root privileges before setting process priority and CPU governor, providing user guidance for optimal performance.

This commit is contained in:
Alireza
2025-08-02 18:07:04 +03:30
parent 896831aa46
commit 6611207737
3 changed files with 225 additions and 4 deletions

View File

@@ -14,14 +14,26 @@ echo "⚙️ Configuring system for high-performance processing..."
echo "* Setting file descriptor limits..."
ulimit -n 65536
# Set process priority
# Set process priority (only if we have permission)
echo "* Setting process priority..."
renice -n -10 $$
if [ "$EUID" -eq 0 ]; then
renice -n -10 $$
echo "✅ Process priority set to -10"
else
echo "⚠️ Cannot set process priority (requires root privileges)"
echo "💡 Run with sudo for optimal performance"
fi
# Configure CPU governor for performance
# Configure CPU governor for performance (only if we have permission)
echo "* Configuring CPU governor..."
if command -v cpupower &> /dev/null; then
sudo cpupower frequency-set -g performance
if [ "$EUID" -eq 0 ]; then
cpupower frequency-set -g performance
echo "✅ CPU governor set to performance mode"
else
echo "⚠️ Cannot set CPU governor (requires root privileges)"
echo "💡 Run with sudo for optimal performance"
fi
fi
# Set environment variables for optimal performance