← back to Exo
test
6169996c707a38485daa453bab22545c6127db48 · 2024-12-11 16:35:26 +0000 · Alex Cheema
Files touched
Diff
commit 6169996c707a38485daa453bab22545c6127db48
Author: Alex Cheema <alexcheema123@gmail.com>
Date: Wed Dec 11 16:35:26 2024 +0000
test
---
configure_mlx.sh | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/configure_mlx.sh b/configure_mlx.sh
index f3469c82..77796055 100755
--- a/configure_mlx.sh
+++ b/configure_mlx.sh
@@ -30,6 +30,14 @@ echo "Total memory: $TOTAL_MEM_MB MB"
echo "Maximum limit (iogpu.wired_limit_mb): $WIRED_LIMIT_MB MB"
echo "Lower bound (iogpu.wired_lwm_mb): $WIRED_LWM_MB MB"
-# Apply the values with sysctl
-sudo sysctl -w iogpu.wired_limit_mb=$WIRED_LIMIT_MB
-sudo sysctl -w iogpu.wired_lwm_mb=$WIRED_LWM_MB
\ No newline at end of file
+# Apply the values with sysctl, but check if we're already root
+if [ "$EUID" -eq 0 ]; then
+ sysctl -w iogpu.wired_limit_mb=$WIRED_LIMIT_MB
+ sysctl -w iogpu.wired_lwm_mb=$WIRED_LWM_MB
+else
+ # Try without sudo first, fall back to sudo if needed
+ sysctl -w iogpu.wired_limit_mb=$WIRED_LIMIT_MB 2>/dev/null || \
+ sudo sysctl -w iogpu.wired_limit_mb=$WIRED_LIMIT_MB
+ sysctl -w iogpu.wired_lwm_mb=$WIRED_LWM_MB 2>/dev/null || \
+ sudo sysctl -w iogpu.wired_lwm_mb=$WIRED_LWM_MB
+fi
\ No newline at end of file
← bbb58460 Test on m4
·
back to Exo
·
test2 b7bab80e →