1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

fix(train): extract f0 & feature hang

This commit is contained in:
源文雨
2026-04-18 17:03:52 +08:00
parent 96f7bccb12
commit cc50ede4fb
2 changed files with 13 additions and 1 deletions

View File

@@ -106,6 +106,12 @@ if __name__ == "__main__":
Config.use_insecure_load()
printt(" ".join(sys.argv))
# GPU methods (rmvpe, fcpe, crepe, etc.) gain nothing from multiprocessing since
# all processes share one GPU. Spawning n_p processes each lazily loading
# the model onto the same CUDA device exhausts VRAM and causes deadlocks.
if "cuda" in device:
printt("WARN: use 1 thread since GPU is used.")
n_p = 1
featureInput = FeatureInput(is_half, device)
paths = []
inp_root = "%s/1_16k_wavs" % (exp_dir)

View File

@@ -17,7 +17,13 @@ device = sys.argv[1]
n_part = int(sys.argv[2])
i_part = int(sys.argv[3])
i_gpu = sys.argv[4]
os.environ["CUDA_VISIBLE_DEVICES"] = str(i_gpu)
# CUDA_VISIBLE_DEVICES expects bare GPU indices (e.g. "0" or "0,1"),
# but callers may pass "cuda:0", "cuda:0-cuda:1", etc. Strip the prefix
# and normalise separators so any combination works.
import re
i_gpu = re.sub(r'cuda:', '', str(i_gpu))
i_gpu = i_gpu.replace('-', ',')
os.environ["CUDA_VISIBLE_DEVICES"] = i_gpu
exp_dir = sys.argv[5]
version = sys.argv[6]
is_half = sys.argv[7].lower() == "true"