Intel® Optimized AI Frameworks
Receive community support for questions related to PyTorch* and TensorFlow* frameworks.
88 討論

torch.xpu.is_available() AttributeError: module 'torch' has no attribute 'xpu'

musical-one
初學者
8,030 檢視

I am getting the following error. I am using oneapi.

 

(pytorch) u178728@s001-n157:~$ python
Python 3.9.13 (main, Oct 19 2022, 17:23:07)
[GCC 11.2.0] :: Intel Corporation on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import torch
>>> import intel_extension_for_pytorch
>>> torch.xpu.is_available()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'torch' has no attribute 'xpu'

 

Please help. 

0 積分
3 回應
AthiraM_Intel
主席
7,993 檢視

Hi,


Thank you for posting in Intel Communities.


We are able to reproduce the issue from our end. We are checking on this internally, will let you know the updates soon.



Thanks


Jing_Xu
員工
7,971 檢視

GPU support hasn't been included in oneAPI AI Analytics Toolkit.

Please check the tutorial for installation guide and system requirements.


Aditya18
主席
7,928 檢視

Hi,

We have seen no response from user in last 7 days. We'll close the case by 13 Dec if no further response comes.

Or if you are happy with the answer please mark it as the solution.


To add more on Jing's answer

On DevCloud, oneAPI AI Analytics Toolkit have environment for IPEX CPU build not for IPEX GPU. For Intel GPU, we need to install it manually after installing the GPU drivers. Can check the IPEX GPU installation guide: https://intel.github.io/intel-extension-for-pytorch/xpu/latest/

Regarding the attribute error, Are you referring to checking IPEX GPU installation using this command torch.xpu.is_available() like torch.cuda.is_available()?

If yes. this command only works in IPEX GPU installation. It's not yet available for IPEX CPU and other PyTorch installations.


回覆