Driver confusions

更多
2026-01-18 09:21 - 2026-01-18 09:28 #1035 by service
新帖
Hardware: 英特尔® 酷睿™ Ultra 5 处理器 125H

Now installed检查已安装的驱动:
Code:
pip list | Select-String "torch"  # 只查看torch相关

>> pytorch-triton-xpu         3.4.0
>> torch                      2.8.0+xpu
>> torchaudio                 2.8.0+xpu
>> torchsde                   0.2.6
>> torchvision                0.23.0+xpu

批量卸载
# 批量卸载,一次性确认
pip uninstall torch torchvision torchaudio intel-extension-for-pytorch -y

# 或者分开卸载但都自动确认
pip uninstall torch -y
pip uninstall torchvision -y
pip uninstall torchaudio -y
pip uninstall intel-extension-for-pytorch -y强力清理(如果普通卸载失败)# 如果卸载失败,可以尝试强制删除
# 找到包的安装位置
pip show torch | findstr "Location"

# 手动删除残留文件(谨慎操作!)
# 通常位置在:Python安装目录\Lib\site-packages\
# 例如:
Remove-Item -Path "C:\Python310\Lib\site-packages\torch*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Python310\Lib\site-packages\torchvision*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Python310\Lib\site-packages\torchaudio*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Python310\Lib\site-packages\intel_extension_for_pytorch*" -Recurse -Force -ErrorAction SilentlyContinue

Downloaded drivers:
Powershell
Code:
(Get-ChildItem -Recurse | Select-Object Name) PS E:\AI\driver\intel> Get-ChildItem -Recurse | Select-Object Name Name ---- intel_extension_for_pytorch-2.8.10+xpu-cp310-cp310-win_amd64.whl torch-2.5.1+cxx11.abi-cp310-cp310-win_amd64.whl torchaudio-2.5.1+cxx11.abi-cp310-cp310-win_amd64.whl torchvision-0.20.1+cxx11.abi-cp310-cp310-win_amd64.whl PS E:\AI\driver\pytorch> Get-ChildItem -Recurse | Select-Object Name Name ---- pytorch_triton_xpu-3.4.0-cp310-cp310-win_amd64.whl torch-2.8.0+xpu-cp310-cp310-win_amd64.whl torchaudio-2.8.0+xpu-cp310-cp310-win_amd64.whl torchvision-0.23.0+xpu-cp310-cp310-win_amd64.whl


Install intel drivers
cd "E:\AI\driver\intel"

# 1. 先安装 PyTorch
pip install "torch-2.5.1+cxx11.abi-cp310-cp310-win_amd64.whl"

# 2. 再安装 torchvision 和 torchaudio
pip install "torchvision-0.20.1+cxx11.abi-cp310-cp310-win_amd64.whl"
pip install "torchaudio-2.5.1+cxx11.abi-cp310-cp310-win_amd64.whl"

# 3. 最后安装 Intel Extension for PyTorch
pip install "intel_extension_for_pytorch-2.8.10+xpu-cp310-cp310-win_amd64.whl"

验证安装是否成功
# 检查所有包是否安装成功
python -c "import torch; print(f'PyTorch版本: {torch.__version__}')"
python -c "import torchvision; print(f'torchvision版本: {torchvision.__version__}')"
python -c "import torchaudio; print(f'torchaudio版本: {torchaudio.__version__}')"
python -c "import intel_extension_for_pytorch as ipex; print(f'IPEX版本: {ipex.__version__}')"

# 检查是否支持XPU(Intel GPU)
python -c "import torch; print(f'XPU可用: {torch.xpu.is_available()}')"
----

如果安装Pytorch:
# 切换到目录
cd "E:\AI\driver\pytorch"

# 切换到目录
cd "E:\AI\driver\pytorch"

# 第一步:先安装 pytorch-triton-xpu(它是 torch 的依赖)
pip install "pytorch_triton_xpu-3.4.0-cp310-cp310-win_amd64.whl"

# 第二步:安装 PyTorch
pip install "torch-2.8.0+xpu-cp310-cp310-win_amd64.whl"

# 第三步:安装 torchvision
pip install "torchvision-0.23.0+xpu-cp310-cp310-win_amd64.whl"

# 第四步:安装 torchaudio
pip install "torchaudio-2.8.0+xpu-cp310-cp310-win_amd64.whl"
 
Last edit: 2026-01-18 09:28 by service.

登录注册一个帐号 参加讨论

更多
2026-01-18 09:32 #1036 by service
Replied by service on topic Driver confusions
安装完intel的提示错误:PS F:\ai\fastapi> python app.py
Traceback (most recent call last):
File "F:\ai\fastapi\app.py", line 9, in <module>
import torch
File "D:\Program Files\Python310\lib\site-packages\torch\__init__.py", line 262, in <module>
_load_dll_libraries()
File "D:\Program Files\Python310\lib\site-packages\torch\__init__.py", line 258, in _load_dll_libraries
raise err
OSError: [WinError 126] 找不到指定的模块。 Error loading "D:\Program Files\Python310\lib\site-packages\torch\lib\aoti_custom_ops.dll" or one of its dependencies.
安装完Pytorch的提示错误:
PS F:\ai\fastapi> python app.py
Traceback (most recent call last):
File "F:\ai\fastapi\app.py", line 9, in <module>
import torch
File "D:\Program Files\Python310\lib\site-packages\torch\__init__.py", line 278, in <module>
_load_dll_libraries()
File "D:\Program Files\Python310\lib\site-packages\torch\__init__.py", line 261, in _load_dll_libraries
raise err
OSError: [WinError 127] 找不到指定的程序。 Error loading "D:\Program Files\Python310\lib\site-packages\torch\lib\c10_xpu.dll" or one of its dependencies.

登录注册一个帐号 参加讨论

更多
2026-01-18 09:50 - 2026-01-18 11:01 #1037 by service
Replied by service on topic Driver confusions
遇到:Error loading "盘符:\***\Python310\lib\site-packages\torch\lib\c10_xpu.dll" or one of its dependencies.返回只安装intel的驱动:完全清理已安装的
Code:
# 1. 先完全清理 pip uninstall torch torchvision torchaudio intel-extension-for-pytorch pytorch-triton-xpu -y # 2. 删除残留文件 $pythonDir = "D:\Program Files\Python310" $torchDirs = @(     "$pythonDir\Lib\site-packages\torch",     "$pythonDir\Lib\site-packages\torchvision",      "$pythonDir\Lib\site-packages\torchaudio",     "$pythonDir\Lib\site-packages\intel_extension_for_pytorch",     "$pythonDir\Lib\site-packages\pytorch_triton_xpu" ) foreach ($dir in $torchDirs) {     if (Test-Path $dir) {         Remove-Item $dir -Recurse -Force -ErrorAction SilentlyContinue         Write-Host "删除: $dir" -ForegroundColor Yellow     } } # 3. 重新安装(先试 CPU 版本) pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu # 4. 测试 python -c "import torch; print(f'PyTorch {torch.__version__} 安装成功'); print(f'可用设备: CPU')"

----
安装intel后,查看已安装:

PS E:\AI\driver\pytorch> pip list | Select-String "torch"

torch 2.5.1+cpu
torchaudio 2.5.1+cpu
torchsde 0.2.6
torchvision 0.20.1+cpu
Last edit: 2026-01-18 11:01 by service.

登录注册一个帐号 参加讨论