Skip to content

Instantly share code, notes, and snippets.

@satisanTV
Last active August 17, 2020 22:01
Show Gist options
  • Save satisanTV/eb6f0f93b94abbbbf1a6f83bedd15cdd to your computer and use it in GitHub Desktop.
Save satisanTV/eb6f0f93b94abbbbf1a6f83bedd15cdd to your computer and use it in GitHub Desktop.
Installation of ShogiGUI + Yaneuraou (neural network engine) under Wine

I am using the latest links as of the time of writing, but you can check here :

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y p7zip-full wine-stable wine32 wine64 winetricks

export WINEPREFIX=$HOME/.wine-shogigui
export WINEARCH=win64
wineboot --init

winetricks dotnet45
winetricks cjkfonts

tmpdir=$(mktemp -d /tmp/shogi_XXXXX)
cd $tmpdir
wget http://shogigui.siganus.com/shogigui/ShogiGUIv0.0.7.14.exe

wget https://github.com/yaneurao/YaneuraOu/releases/download/V4.88/YaneuraOu2019V488all.zip
unzip YaneuraOu2019V488all.zip

yaneuraou_type="YaneuraOu2018NNUE"
target_dir="$WINEPREFIX/drive_c/users/Public/Shogi"
target_file="$target_dir/$yaneuraou_type.exe"
mkdir $target_dir

(lscpu | grep -q avx    && cp ${yaneuraou_type}_avx2.exe $target_file) || \
(lscpu | grep -q sse4_2 && cp ${yaneuraou_type}_sse42.exe $target_file) || \
(lscpu | grep -q sse4_1 && cp ${yaneuraou_type}_sse41.exe $target_file) || \
(lscpu | grep -q sse2   && cp ${yaneuraou_type}_sse2.exe $target_file) || cp ${yaneuraou_type}_nosse.exe $target_file

wget https://www.qhapaq.org/static/media/bin/orqha.7z
7z x orqha.7z
mv orqha $target_dir/

Let's install ShogiGUI :

wine ShogiGUIv0.0.7.14.exe
wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/ShogiGUI/ShogiGUI.exe

Tools (T) / Options (O) / Language, choose English, close and restart the app with (you can make a script out of this) :

export WINEPREFIX=$HOME/.wine-shogigui 
wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/ShogiGUI/ShogiGUI.exe

Tools (T) / Engine Settings (E) / Add

Go to c:/users/Public/Shogi, choose YaneuraOu2018NNUE.exe

In the engine parameters, choose : "EvalDir : orqha"

If everything went as planned, "Consider" / "Analysis", etc should now work fine with YaneuraOu !

Final cleanup (will be done automatically on next reboot otherwise)

cd
grep -q /tmp <<< "$tmpdir" && rm -rf "$tmpdir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment