Intel® XPU Library for PyTorch* Ecosystem Projects
This project contains a set of plugins for PyTorch* ecosystem libraries which enable hardware acceleration on Intel® GPUs thru the xpu PyTorch* device backend. The goal of the project is to:
- Facilitate enabling of the Intel® GPUs support across PyTorch* ecosystem projects
- Provide the plugins till the support for Intel® GPUs will be accepted in the respective upstream projects
At the moment project provides plugins for the following frameworks:
- Intel® XPU plugin for TorchCodec
Plugins
Intel® XPU plugin for TorchCodec
TorchCodec is a high-performance Python library designed for media processing (decoding and encoding) using PyTorch* tensors. Intel® XPU plugin for TorchCodec enables hardware acceleration for video operations (only decoding at the moment) on Linux. Both TorchCodec and Intel® plugin rely on the FFmpeg libraries for their operations which must be pre-installed on the system. Intel® plugin further assumes that FFmpeg is built with the VAAPI support.
TorchCodec will automatically load Intel® XPU plugin if it is installed on the system via Python packages entry point mechanism. After importing TorchCodec, pass XPU device to initialize TorchCodec decoder or encoder:
import torchcodec
decoder = torchcodec.decoders.VideoDecoder(
"input.mp4", device="xpu:0")
Installation
Pre-built release wheels are available at PyPI. Installation requires PyTorch with enabled XPU support which can be fetched from https://download.pytorch.org/whl/xpu:
pip install torchlib-xpu \
--extra-index-url https://download.pytorch.org/whl/xpu
Build from sources
-
Install uv
-
Install oneAPI 2026.0
-
Install FFmpeg development environment with enabled VAAPI hardware acceleration. For example:
- By installing FFmpeg provided by your Linux distribution. For Ubuntu:
apt-get update && apt-get install -y \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswresample-dev \
libswscale-dev
- By self-building FFmpeg from sources:
git clone https://git.ffmpeg.org/ffmpeg.git && cd ffmpeg
./configure \
--prefix=$HOME/_install \
--libdir=$HOME/_install/lib \
--disable-static \
--disable-stripping \
--disable-doc \
--enable-shared \
--enable-vaapi
make -j$(nproc) && make install
export PKG_CONFIG_PATH=$HOME/_install/lib/pkgconfig
export LD_LIBRARY_PATH=$HOME/_install/lib:$LD_LIBRARY_PATH
- Build and install plugins supplied by Intel® XPU Library for PyTorch* Ecosystem Projects:
git clone https://github.com/intel/torchlib-xpu.git && cd torchlib-xpu
uv venv && uv pip install -e . \
--index https://download.pytorch.org/whl/xpu -vv
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torchlib_xpu-0.4.0-py3-none-any.whl.
File metadata
- Download URL: torchlib_xpu-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb2312bb896ece73d21f673406ea4d9f62a4f907c3d79a38b710b1ea716fbe25
|
|
| MD5 |
93af26eed41691ee7ad35a7ace996a96
|
|
| BLAKE2b-256 |
821ed5ecbfc6af20ccb842e70f2a4220233e131493faa5a1453a2670ea8dd74a
|
Provenance
The following attestation bundles were made for torchlib_xpu-0.4.0-py3-none-any.whl:
Publisher:
ci.yml on intel/torchlib-xpu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torchlib_xpu-0.4.0-py3-none-any.whl -
Subject digest:
fb2312bb896ece73d21f673406ea4d9f62a4f907c3d79a38b710b1ea716fbe25 - Sigstore transparency entry: 2589334970
- Sigstore integration time:
-
Permalink:
intel/torchlib-xpu@16301d6e0bd5e7c5f5f7b1951206921a490d7954 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/intel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@16301d6e0bd5e7c5f5f7b1951206921a490d7954 -
Trigger Event:
release
-
Statement type: