mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
reinstall if torch-cpu and use-cuda or use-rocm
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
`torch-directml` received no updates in over 1 year and its currently superceded by `rocm` or `zluda`
|
||||
- command line params `--use-zluda` and `--use-rocm` will attempt desired operation or fail if not possible
|
||||
previously sdnext was performing a fallback to `torch-cpu` which is not desired
|
||||
- if `--use-cuda` or `--use-rocm` are specified and `torch-cpu` is installed, installer will attempt to reinstall correct torch package
|
||||
- **installer**: warn if cuda or rocm are available and `torch-cpu` is installed
|
||||
- **Extensions**
|
||||
- [Agent-Scheduler](https://github.com/SipherAGI/sd-webui-agent-scheduler)
|
||||
|
||||
+12
-2
@@ -953,9 +953,19 @@ def check_torch():
|
||||
pass
|
||||
if 'cpu' in torch.__version__:
|
||||
if is_cuda_available:
|
||||
log.warning(f'Torch: version="{torch.__version__}" CPU version installed and CUDA is available - consider reinstalling')
|
||||
if args.use_cuda:
|
||||
log.warning(f'Torch: version="{torch.__version__}" CPU version installed and CUDA is selected - reinstalling')
|
||||
uninstall(['torch', 'torchvision'], quiet=True)
|
||||
install(torch_command, 'torch torchvision', quiet=True) # foce reinstall
|
||||
else:
|
||||
log.warning(f'Torch: version="{torch.__version__}" CPU version installed and CUDA is available - consider reinstalling')
|
||||
elif is_rocm_available:
|
||||
log.warning(f'Torch: version="{torch.__version__}" CPU version installed and ROCm is available - consider reinstalling')
|
||||
if args.use_rocm:
|
||||
log.warning(f'Torch: version="{torch.__version__}" CPU version installed and ROCm is selected - reinstalling')
|
||||
uninstall(['torch', 'torchvision'], quiet=True)
|
||||
install(torch_command, 'torch torchvision', quiet=True) # foce reinstall
|
||||
else:
|
||||
log.warning(f'Torch: version="{torch.__version__}" CPU version installed and ROCm is available - consider reinstalling')
|
||||
if hasattr(torch, "xpu") and torch.xpu.is_available() and allow_ipex:
|
||||
if shutil.which('icpx') is not None:
|
||||
log.info(f'{os.popen("icpx --version").read().rstrip()}')
|
||||
|
||||
Reference in New Issue
Block a user