| import torch | |
| print(f"PyTorch version: {torch.__version__}") | |
| try: | |
| import intel_extension_for_pytorch as ipex | |
| print(f"IPEX version: {ipex.__version__}") | |
| except ImportError: | |
| print("IPEX not installed") | |
| if hasattr(torch, 'xpu') and torch.xpu.is_available(): | |
| count = torch.xpu.device_count() | |
| print(f"XPU available: {count} device(s)") | |
| for i in range(count): | |
| print(f" XPU {i}: {torch.xpu.get_device_name(i)}") | |
| else: | |
| print("XPU not available") | |
| if torch.cuda.is_available(): | |
| print(f"CUDA available: {torch.cuda.device_count()} device(s)") | |
| else: | |
| print("CUDA not available") | |