Fix: CPU/AMD GPU support and Windows Japanese-username setup#243
Open
baysun2024-oss wants to merge 2 commits into
Open
Fix: CPU/AMD GPU support and Windows Japanese-username setup#243baysun2024-oss wants to merge 2 commits into
baysun2024-oss wants to merge 2 commits into
Conversation
For environments where the Windows username contains non-ASCII characters (e.g. Japanese), the standard uv-managed Python installation ends up in a path like C:\Users\川上貴大\AppData\Roaming\uv\python\... which causes the venv's python.exe to fail with "No Python at '...\????\...'" due to code page issues in some PowerShell sessions. This commit adds: - setup_windows_jp.ps1: automated setup script that works around all known Windows/Japanese-username issues (ASCII Python path, CPU-only PyTorch, faster-whisper version pinning, soxr dependency, transformers 4.x compatibility) - SETUP_WINDOWS_JP.md: step-by-step manual guide covering the same workarounds with troubleshooting for each known error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- train_ms.py, train_ms_jp_extra.py: guard all CUDA calls behind torch.cuda.is_available(); use gloo backend with USE_LIBUV=0 on Windows; replace .cuda(local_rank) with .to(device) throughout; fix DDP to omit device_ids when running on CPU; guard empty_cache() - transcribe.py: auto-detect CUDA for default device/compute_type; fall back to int8 when CPU is used with a float16/bfloat16 type - gradio_tabs/dataset.py: same compute_type auto-detection for WebUI - style_bert_vits2/utils/subprocess.py: set PYTHONIOENCODING=utf-8 in subprocess env to prevent Shift-JIS decode errors on Windows - style_bert_vits2/models/utils/checkpoints.py: pass weights_only=False to torch.load (torch 2.6 changed the default; breaks model loading) - setup_windows_jp.ps1, SETUP_WINDOWS_JP.md: update to torch 2.6.0+cpu (required by transformers 4.57+ CVE-2025-32434 security check) - requirements-custom.txt: add filtered requirements excluding torch, torchaudio, faster-whisper to avoid CPU torch being overwritten
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for running Style-Bert-VITS2 on Windows machines with AMD GPUs (no NVIDIA/CUDA) and Japanese usernames, and fixes several issues encountered during setup and training.
Changes
Training scripts (
train_ms.py,train_ms_jp_extra.py)torch.cuda.is_available()窶・training now works on CPU-only machinesgloobackend withUSE_LIBUV=0on Windows (CPU PyTorch builds lack libuv).cuda(local_rank)/.to(local_rank)calls with.to(device)wheredeviceis resolved at runtimeDistributedDataParallelinitialization to omitdevice_idswhen running on CPUtorch.cuda.empty_cache()callstranscribe.py--deviceand--compute_typeargumentsint8when CPU is used with an incompatible float16/bfloat16 compute typegradio_tabs/dataset.pystyle_bert_vits2/utils/subprocess.pyPYTHONIOENCODING=utf-8in subprocess environment to preventUnicodeDecodeError(Shift-JIS) on Japanese Windowsstyle_bert_vits2/models/utils/checkpoints.pyweights_only=Falsetotorch.load窶・PyTorch 2.6 changed the default toTrue, which breaks loading existing checkpoints containing custom classesrequirements-custom.txt(new)torch,torchaudio,faster-whisperfor use in CPU-only installssetup_windows_jp.ps1+SETUP_WINDOWS_JP.md(new)C:\Python310), uv venv creation, CPU torch install, all known quirksBackground
On Windows with a Japanese username (e.g.
C:\Users\蟾昜ク願イエ螟ァ\), the standard setup fails because:uvinstalls Python to a path with Japanese characters, breaking venv resolutiontorch.loaddefaults (CVE-2025-32434), breaking model loadingOn AMD GPU machines with no CUDA, all training scripts assumed CUDA unconditionally.
Testing
Verified end-to-end on Windows 11 Pro with AMD Radeon GPU (CPU-only PyTorch 2.6.0+cpu):