Skip to content

Commit

Permalink
v6.29
Browse files Browse the repository at this point in the history
+ DietPi-Software | Kodi: Apply minimal required 128 MiB GPU memory on RPi automatically during install, even when running a non-interactive install: #3173
  • Loading branch information
MichaIng authored Mar 19, 2020
1 parent 72502c6 commit 309688a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -3669,6 +3669,7 @@ amvdec_vc1
amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf

else

package_list+=' kodi-odroid'

fi
Expand Down Expand Up @@ -3699,6 +3700,10 @@ amvdec_vp9' > /etc/modules-load.d/dietpi-n2-kodi.conf
# https://github.com/MichaIng/DietPi/issues/3031#issuecomment-540477241
mkdir -p /etc/polkit-1/localauthority/50-local.d

# https://github.com/MichaIng/DietPi/issues/3173
local gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024=/{s/^[^=]*=//p;q}' /boot/config.txt)
disable_error=1 G_CHECK_VALIDINT "$gpu_mem" 128 944 || /boot/dietpi/func/dietpi-set_hardware gpumemsplit 128

fi

fi
Expand Down Expand Up @@ -12314,28 +12319,28 @@ _EOF_
# RPi: Define minimal memory split based on installed software
local gpu_memory=0

# - Kodi
# Kodi
if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 )); then

gpu_enabled=1
gpu_memory=320
(( ${G_HW_MEMORY_SIZE:-0} <= 512 )) && gpu_memory=256

# - Mode 4 (Descent)
# Mode 4 (Descent)
elif (( ${aSOFTWARE_INSTALL_STATE[112]} == 1 )); then

gpu_enabled=1
gpu_memory=192

# - Mode 3 (DIETPICAM / UAE4ARM / Chromium)
# Mode 3 (DIETPICAM / UAE4ARM / Chromium)
elif (( ${aSOFTWARE_INSTALL_STATE[59]} == 1 ||
${aSOFTWARE_INSTALL_STATE[108]} == 1 ||
${aSOFTWARE_INSTALL_STATE[113]} == 1 )); then

gpu_enabled=1
gpu_memory=128

# - Mode 2 (Desktops / OpenTyrian)
# Mode 2 (Desktops / OpenTyrian)
elif (( ${aSOFTWARE_INSTALL_STATE[23]} == 1 ||
${aSOFTWARE_INSTALL_STATE[24]} == 1 ||
${aSOFTWARE_INSTALL_STATE[25]} == 1 ||
Expand All @@ -12345,7 +12350,7 @@ _EOF_
gpu_enabled=1
gpu_memory=64

# - Mode 1 - DIETPICLOUDSHELL (forces display output)
# Mode 1 - DIETPICLOUDSHELL (forces display output)
elif (( ${aSOFTWARE_INSTALL_STATE[62]} == 1 )); then

gpu_enabled=1
Expand All @@ -12355,11 +12360,11 @@ _EOF_
# RPi: Apply memory split
if (( $G_HW_MODEL < 10 && $gpu_memory > 0 )); then

# - Never override a higher existing value
local current_gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024/{s/^[^=]*=//p;q}' /boot/config.txt)
# Never override a higher existing value
local current_gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024=/{s/^[^=]*=//p;q}' /boot/config.txt)
G_WHIP_DEFAULT_ITEM='Ok'
if (( $current_gpu_mem < $gpu_memory )) &&
G_WHIP_YESNO "[ INFO ] DietPi has detected an increased GPU memory is required for your installed software:\n - Current: $current_gpu_mem MB\n - Recommended: $gpu_memory MB\n\nWould you like DietPi to apply the recommended GPU memory split?\n\nIf unsure, select 'Ok'."; then
G_WHIP_YESNO "[ INFO ] DietPi has detected an increased GPU memory is required for your installed software:\n - Current: $current_gpu_mem MiB\n - Recommended: $gpu_memory MiB\n\nWould you like DietPi to apply the recommended GPU memory split?\n\nIf unsure, select 'Ok'."; then

/boot/dietpi/func/dietpi-set_hardware gpumemsplit $gpu_memory

Expand Down

0 comments on commit 309688a

Please sign in to comment.