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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user