Skip to content

Commit

Permalink
Added SMT support reference to GloriousEggroll/protonfixes#167
Browse files Browse the repository at this point in the history
  • Loading branch information
Boria138 committed Jan 20, 2024
1 parent 2fb4fd4 commit 9a9c29a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions data_from_portwine/scripts/zen_yad_gui
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ pw_gui_for_edit_db () {

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


logical_cores=$(grep -c "^processor" /proc/cpuinfo)
logical_cores=$(nproc 2>/dev/null)

if [[ $(cat "/sys/devices/system/cpu/smt/active") == "1" ]] ; then
# Currently (2024) SMT allows 2 threads per core, this might change in the future
logical_cores=$(( logical_cores / 2 ))
fi

if [[ "${logical_cores}" -le "4" ]] ; then
GET_LOGICAL_CORE="1!$(seq -s! 1 $((${logical_cores} - 1)))"
else
Expand Down Expand Up @@ -249,9 +254,9 @@ pw_gui_for_edit_db () {
PW_GPU_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $8}'`"
GAMESCOPE_ARGS="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}'`"
# PW_AMD_VULKAN_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $10}'`"

if [[ "${CPU_LIMIT}" != "disabled" ]] ; then
export PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $((${CPU_LIMIT} - 1)))"
export PW_WINE_CPU_TOPOLOGY="${CPU_LIMIT}:$(seq -s, 0 $((${CPU_LIMIT} - 1)))"
else
export PW_WINE_CPU_TOPOLOGY="disabled"
fi
Expand Down

0 comments on commit 9a9c29a

Please sign in to comment.