Intel® Optimized AI Frameworks
Receive community support for questions related to PyTorch* and TensorFlow* frameworks.
73 Discussions

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

musical-one
Beginner
2,914 Views

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 Kudos
3 Replies
AthiraM_Intel
Moderator
2,877 Views

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


0 Kudos
Jing_Xu
Employee
2,855 Views

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

Please check the tutorial for installation guide and system requirements.


0 Kudos
Aditya18
Moderator
2,812 Views

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.


0 Kudos
Reply