找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
楼主: rafavi

英特尔(Intel)集成显卡也能使用GPU为模型训练加速(以Intel(R) iris(R) Xe Graphi

[复制链接]

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 2025-5-5 17:05:54 | 显示全部楼层
指定源:
pip install intel-extension-for-pytorch --index-url https://mirrors.aliyun.com/pypi/simple/ (无)
pip install intel-extension-for-pytorch -i https://mirrors.aliyun.com/pypi/simple (无)
pip install intel-extension-for-pytorch -i https://pypi.tuna.tsinghua.edu.cn/simple (无)
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 2025-5-5 22:26:43 | 显示全部楼层
pip install torch==2.3.0 -f https://developer.intel.com/ipex-whl-stable-xpu
pip install intel_extension_for_pytorch==2.3.0 -f https://developer.intel.com/ipex-whl-stable-xpu
pip install torch==2.3 --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
pip install intel_extension_for_pytorch==2.3.110+xpu --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ (这个可以)
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 2025-5-5 22:41:00 | 显示全部楼层
Intel 提供了 针对 XPU 优化的 torchvision 和 torchaudio,但需要从 Intel 的官方仓库 安装,而不是 PyPI。
pip install torchvision==0.18.0 --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
pip install torchaudio==2.3.0 --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
注意:必须使用 --index-url 指定 Intel 的仓库,否则会安装 PyPI 上的普通版本(不支持 XPU)
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 2025-5-6 08:32:31 | 显示全部楼层
pip cache purge
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 2025-5-8 10:47:17 | 显示全部楼层
更新镜像:
  1. pip install jupyter -i http://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host=pypi.mirrors.ustc.edu.cn
复制代码
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 2025-5-8 10:51:50 | 显示全部楼层
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 7 天前 | 显示全部楼层
关键是要从Intel的源安装所有依赖,而不仅仅是主包。pip 默认会从PyPI查找依赖,需要强制它也从Intel源查找。

方案:指定额外的索引URL(推荐)
使用 --extra-index-url 参数,告诉pip:如果主索引(PyPI)找不到包,就到Intel的源去找。这样既能解决Intel特有的依赖,又能从PyPI获取其他通用包。
  1. pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 intel-extension-for-pytorch==2.5.10 --index-url https://pypi.org/simple/ --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
复制代码


Successfully installed dpcpp-cpp-rt-2025.0.4 intel-cmplr-lib-rt-2025.0.4 intel-cmplr-lib-ur-2025.0.4 intel-cmplr-lic-rt-2025.0.4 intel-extension-for-pytorch-2.5.10+xpu intel-opencl-rt-2025.0.4 intel-openmp-2025.0.4 intel-sycl-rt-2025.0.4 sympy-1.13.1 torch-2.5.1+cxx11.abi torchaudio-2.5.1+cxx11.abi torchvision-0.20.1+cxx11.abi
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 7 天前 | 显示全部楼层
从Intel源重新安装(关键改动)
不使用PyPI源,完全依赖Intel源:

  1. pip install torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi torchaudio==2.5.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ --trusted-host pytorch-extension.intel.com
复制代码

注意:版本号必须完全匹配Intel源中的格式(包含 +cxx11.abi 和 +xpu 后缀)。
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 7 天前 | 显示全部楼层
使用Intel官方安装方法

Intel PyTorch扩展在Windows上有特定的安装要求。让我们按官方推荐步骤操作:

步骤1:完全卸载并清理(彻底)

bash
# 卸载所有相关包
  1. pip uninstall torch torchvision torchaudio intel-extension-for-pytorch -y
复制代码


# 清理可能的残留文件
  1. pip cache purge
复制代码

步骤2:删除残留目录(重要!)
确保删除:

D:\Program Files\Python310\Lib\site-packages\torch\

D:\Program Files\Python310\Lib\site-packages\intel_extension_for_pytorch\

步骤3:安装Intel OneAPI基础运行时
Intel PyTorch XPU需要OneAPI基础组件。请访问并下载:
https://www.intel.com/content/ww ... psible1767961942340[/url]

或者尝试直接安装DPCPP运行时:

  1. pip install dpcpp-cpp-rt --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
复制代码

步骤4:使用官方推荐命令安装
根据Intel官方文档,Windows上的推荐安装命令是:

  1. pip install torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi torchaudio==2.5.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
复制代码

步骤5:验证DLL依赖(关键检查)
安装后,检查DLL文件是否存在:

  1. dir "D:\Program Files\Python310\lib\site-packages\torch\lib\aoti_custom_ops.dll"
复制代码

如果文件存在但无法加载,使用Dependency Walker或类似工具检查缺失的依赖。
回复

使用道具 举报

113

主题

46

回帖

680

积分

高级会员

积分
680
 楼主| 发表于 7 天前 | 显示全部楼层
ERROR: Could not find a version that satisfies the requirement oneccl-bind-pt (from versions: none)
ERROR: No matching distribution found for oneccl-bind-pt

诊断结果显示

✅ 系统DLL都正常 - VC++ Redistributable已安装
✅ 部分Intel DLL存在 - OpenCL.dll 和 ze_loader.dll 在系统目录
❌ 关键Intel DLL缺失 - sycl.dll 和 ze_intel_gpu64_1.dll 未找到

🎯 问题根源
aoti_custom_ops.dll 依赖 Intel SYCL运行时 (sycl.dll) 和 Intel GPU驱动组件 (ze_intel_gpu64_1.dll),但这些文件不在系统中。

🛠️ 立即解决方案
方案:安装Intel oneAPI Base Toolkit(首选)
这是最完整、最可靠的解决方案:

下载 Intel® oneAPI Base Toolkit

运行安装程序,选择"Custom"安装

确保勾选这些组件:

✅ Intel® oneAPI DPC++/C++ Compiler

✅ Intel® oneAPI DPC++ Library

✅ Intel® oneAPI Threading Building Blocks

完成安装后重启系统
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


QQ|Archiver|手机版|小黑屋|Bluetooth-UWB 联盟论坛 ( 京ICP备19003900号-5 )

GMT+8, 2026-1-24 04:36 , Processed in 0.018276 second(s), 30 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表