Intel Arc: runtime error: invalid device, must be xpu device
Hi, I'm attempting to run locally on Ubuntu 23.10.
Python 3.10 has been installed conda, along with pip. I've found that with the requirements-ipex.txt included in the repo by default, my Intel Arc A770 isn't recognized when I start the web interface.
To resolve that, I've modified the file. The first 5 lines have been replaced with the following:
torch==2.1.0a0 intel-extension-for-pytorch==2.1.10+xpu torchvision==0.16.0a0 torchaudio==2.1.0a0 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
With those changes in place, the card is now recognized. Process Data and Feature Extraction work, but when I get to Train Model, there are errors.
Here is the error in full:
2024-01-07 14:27:28 | INFO | httpx | HTTP Request: POST http://localhost:7865/api/predict "HTTP/1.1 200 OK"
2024-01-07 14:27:28 | INFO | httpx | HTTP Request: POST http://localhost:7865/api/predict "HTTP/1.1 200 OK"
2024-01-07 14:27:28 | INFO | httpx | HTTP Request: POST http://localhost:7865/reset "HTTP/1.1 200 OK"
2024-01-07 14:27:30 | INFO | __main__ | Use gpus: 0
2024-01-07 14:27:30 | INFO | __main__ | "/home/aliasf/anaconda3/envs/intel_pytorch/bin/python" infer/modules/train/train.py -e "mi-test" -sr 40k -f0 1 -bs 7 -g 0 -te 20 -se 5 -pg assets/pretrained_v2/f0G40k.pth -pd assets/pretrained_v2/f0D40k.pth -l 0 -c 0 -sw 0 -v v2
/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
warn(
/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: ''If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
warn(
INFO:mi-test:{'data': {'filter_length': 2048, 'hop_length': 400, 'max_wav_value': 32768.0, 'mel_fmax': None, 'mel_fmin': 0.0, 'n_mel_channels': 125, 'sampling_rate': 40000, 'win_length': 2048, 'training_files': './logs/mi-test/filelist.txt'}, 'model': {'filter_channels': 768, 'gin_channels': 256, 'hidden_channels': 192, 'inter_channels': 192, 'kernel_size': 3, 'n_heads': 2, 'n_layers': 6, 'p_dropout': 0, 'resblock': '1', 'resblock_dilation_sizes': [[1, 3, 5], [1, 3, 5], [1, 3, 5]], 'resblock_kernel_sizes': [3, 7, 11], 'spk_embed_dim': 109, 'upsample_initial_channel': 512, 'upsample_kernel_sizes': [16, 16, 4, 4], 'upsample_rates': [10, 10, 2, 2], 'use_spectral_norm': False}, 'train': {'batch_size': 7, 'betas': [0.8, 0.99], 'c_kl': 1.0, 'c_mel': 45, 'epochs': 20000, 'eps': 1e-09, 'fp16_run': True, 'init_lr_ratio': 1, 'learning_rate': 0.0001, 'log_interval': 200, 'lr_decay': 0.999875, 'seed': 1234, 'segment_size': 12800, 'warmup_epochs': 0}, 'model_dir': './logs/mi-test', 'experiment_dir': './logs/mi-test', 'save_every_epoch': 5, 'name': 'mi-test', 'total_epoch': 20, 'pretrainG': 'assets/pretrained_v2/f0G40k.pth', 'pretrainD': 'assets/pretrained_v2/f0D40k.pth', 'version': 'v2', 'gpus': '0', 'sample_rate': '40k', 'if_f0': 1, 'if_latest': 0, 'save_every_weights': '0', 'if_cache_data_in_gpu': 0}
/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:30: UserWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
warnings.warn("torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.")
DEBUG:infer.lib.infer_pack.models:gin_channels: 256, self.spk_embed_dim: 109
Process Process-49:
Traceback (most recent call last):
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/aliasf/software/Retrieval-based-Voice-Conversion-WebUI/infer/modules/train/train.py", line 184, in run
net_g = net_g.cuda(rank)
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 918, in cuda
return self._apply(lambda t: t.cuda(device))
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 833, in _apply
param_applied = fn(param)
File "/home/aliasf/anaconda3/envs/intel_pytorch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 918, in <lambda>
return self._apply(lambda t: t.cuda(device))
RuntimeError: Invalid device, must be xpu device
2024-01-07 14:27:37 | INFO | httpx | HTTP Request: POST http://localhost:7865/api/predict "HTTP/1.1 200 OK"
2024-01-07 14:27:37 | INFO | httpx | HTTP Request: POST http://localhost:7865/reset "HTTP/1.1 200 OK"
This issue was closed because it has been inactive for 15 days since being marked as stale.