mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-25 15:04:33 +08:00
修复了部分显卡无法正确识别的问题
优化了config.py中对于显卡的判断逻辑。原本的判断逻辑会导致2080Ti无法被正确识别。
This commit is contained in:
parent
dbf7702b54
commit
ee1c71f198
13
config.py
13
config.py
@ -158,13 +158,14 @@ def get_device_dtype_sm(idx: int) -> tuple[torch.device, torch.dtype, float, flo
|
|||||||
major, minor = capability
|
major, minor = capability
|
||||||
sm_version = major + minor / 10.0
|
sm_version = major + minor / 10.0
|
||||||
is_16_series = bool(re.search(r"16\d{2}", name))
|
is_16_series = bool(re.search(r"16\d{2}", name))
|
||||||
if mem_gb < 4:
|
if mem_gb < 4 or sm_version < 5.3:
|
||||||
return cpu, torch.float32, 0.0, 0.0
|
return cpu, torch.float32, 0.0, 0.0
|
||||||
if (sm_version >= 7.0 and sm_version != 7.5) or (5.3 <= sm_version <= 6.0):
|
if sm_version < 6.0:
|
||||||
if is_16_series and sm_version == 7.5:
|
return cuda, torch.float32, sm_version, mem_gb
|
||||||
return cuda, torch.float32, sm_version, mem_gb # 16系卡除外
|
if is_16_series and sm_version == 7.5: # 16系列不使用float16
|
||||||
else:
|
return cuda, torch.float32, sm_version, mem_gb
|
||||||
return cuda, torch.float16, sm_version, mem_gb
|
if sm_version >= 7.0:
|
||||||
|
return cuda, torch.float16, sm_version, mem_gb
|
||||||
return cpu, torch.float32, 0.0, 0.0
|
return cpu, torch.float32, 0.0, 0.0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user