Skip to main content

OpenSSF Scorecard Coverity Scan Build Status

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:

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torchlib_xpu-0.3.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file torchlib_xpu-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: torchlib_xpu-0.3.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

Hashes for torchlib_xpu-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c02b72674eb3d2e99869cb76b8cf0e5cebe72648f1dfcfca8838aa0d955eccf
MD5 5ec491a04b5ac6b405351fdc2ebfcce4
BLAKE2b-256 2fc9e352c2cc1f522fc8e0f943a1d9ac6f7a694587097e3ec596d4ad7c82ac6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for torchlib_xpu-0.3.0-py3-none-any.whl:

Publisher: ci.yml on intel/torchlib-xpu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

1 file

This release

0.3.0 This release

1 file

0.2.0

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page