[object Object]

← back to Exo

Edit configure_mlx.sh for calculate dinamically the value for iogpu.wired_limit_mb and iogpu.wired_lwm_mb. The script limit wired_limit_mb to 80% and wired_lwm_mb to 70%, but this threshold are variables.

84ce076860ee31542599e1065e8a7f13b0952518 · 2024-11-14 00:22:26 +0100 · Giuseppe Gambino

Files touched

Diff

commit 84ce076860ee31542599e1065e8a7f13b0952518
Author: Giuseppe Gambino <giuseppe.gambino.g92@gmail.com>
Date:   Thu Nov 14 00:22:26 2024 +0100

    Edit configure_mlx.sh for calculate dinamically the value for iogpu.wired_limit_mb and iogpu.wired_lwm_mb. The script limit wired_limit_mb to 80% and wired_lwm_mb to 70%, but this threshold are variables.
---
 configure_mlx.sh | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/configure_mlx.sh b/configure_mlx.sh
index 90283968..8a5b6737 100755
--- a/configure_mlx.sh
+++ b/configure_mlx.sh
@@ -3,15 +3,10 @@
 # Get the total memory in MB
 TOTAL_MEM_MB=$(($(sysctl -n hw.memsize) / 1024 / 1024))
 
-# Calculate the maximum limit as 80% of the total memory
+# Set WIRED_LIMIT_MB to 80%
 WIRED_LIMIT_MB=$(($TOTAL_MEM_MB * 80 / 100))
-
-# Calculate the lower bound as 60%-80% of the maximum limit
-WIRED_LWM_MIN=$(($WIRED_LIMIT_MB * 60 / 100))
-WIRED_LWM_MAX=$(($WIRED_LIMIT_MB * 80 / 100))
-
-# Choose a mid-range value for wired_lwm_mb
-WIRED_LWM_MB=$(($WIRED_LWM_MIN + ($WIRED_LWM_MAX - $WIRED_LWM_MIN) / 2))
+# Set  WIRED_LWM_MB to 70%
+WIRED_LWM_MB=$(($TOTAL_MEM_MB * 70 / 100))
 
 # Display the calculated values
 echo "Total memory: $TOTAL_MEM_MB MB"
@@ -20,4 +15,4 @@ 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
+sudo sysctl -w iogpu.wired_lwm_mb=$WIRED_LWM_MB
\ No newline at end of file

← 59f5b6d8 adding back in set error message  ·  back to Exo  ·  cleaning up logging in index.js 25d67f50 →