-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WindowsではPyInstallerのbootloaderをカスタマイズする (#596)
Co-authored-by: Yuto Ashida <[email protected]> Co-authored-by: Hiroshiba <[email protected]> Resolves #502
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# PyInstallerをカスタマイズしてから再インストールする | ||
# 良いGPUが自動的に選択されるようにしている | ||
# https://github.com/VOICEVOX/voicevox_engine/issues/502 | ||
|
||
set -eux | ||
|
||
pyinstaller_version=$(pyinstaller -v) | ||
tempdir=$(mktemp -dt modify_pyinstaller.XXXXXXXX) | ||
trap 'rm -rf "$tempdir"' EXIT | ||
git clone https://github.com/pyinstaller/pyinstaller.git "$tempdir" -b "v$pyinstaller_version" --depth 1 | ||
cat > "$tempdir/bootloader/src/symbols.c" << EOF | ||
#ifdef _WIN32 | ||
#include <windows.h> | ||
// https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm | ||
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; | ||
// https://gpuopen.com/learn/amdpowerxpressrequesthighperformance/ | ||
__declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; | ||
#endif | ||
EOF | ||
(cd "$tempdir/bootloader" && python ./waf all) | ||
pip install -U "$tempdir" |