Skip to content

Commit 9a9c29a

Browse files
committed
Added SMT support reference to GloriousEggroll/protonfixes#167
1 parent 2fb4fd4 commit 9a9c29a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

data_from_portwine/scripts/zen_yad_gui

+9-4
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,13 @@ pw_gui_for_edit_db () {
167167

168168
GET_GPU_NAMES=$("$PW_VULKANINFO_PORTABLE" 2>/dev/null | awk -F '=' '/deviceName/{print $2}' | sed '/llvm/d'| sort -u | sed 's/^ //' | paste -sd '!')
169169

170-
171-
logical_cores=$(grep -c "^processor" /proc/cpuinfo)
170+
logical_cores=$(nproc 2>/dev/null)
171+
172+
if [[ $(cat "/sys/devices/system/cpu/smt/active") == "1" ]] ; then
173+
# Currently (2024) SMT allows 2 threads per core, this might change in the future
174+
logical_cores=$(( logical_cores / 2 ))
175+
fi
176+
172177
if [[ "${logical_cores}" -le "4" ]] ; then
173178
GET_LOGICAL_CORE="1!$(seq -s! 1 $((${logical_cores} - 1)))"
174179
else
@@ -249,9 +254,9 @@ pw_gui_for_edit_db () {
249254
PW_GPU_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $8}'`"
250255
GAMESCOPE_ARGS="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}'`"
251256
# PW_AMD_VULKAN_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}'`"
252-
257+
253258
if [[ "${CPU_LIMIT}" != "disabled" ]] ; then
254-
export PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $((${CPU_LIMIT} - 1)))"
259+
export PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $((${CPU_LIMIT} - 1)))"
255260
else
256261
export PW_WINE_CPU_TOPOLOGY="disabled"
257262
fi

0 commit comments

Comments
 (0)