Skip to main content

Intel® XPU Library for PyTorch* Ecosystem Projects

Project description

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.

To use Intel® XPU plugin for TorchCodec, load it in the Python script and pass XPU device to initialize TorchCodec decoder or encoder:

import torchcodec
import torchcodec_xpu

decoder = torchcodec.decoders.VideoDecoder(
    "input.mp4", device="xpu:0")

Build from sources

  • Install uv

  • Install oneAPI 2025.3

  • 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 torch -e . \
  --index https://download.pytorch.org/whl/xpu -vv

Project details


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.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torchlib_xpu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.65.0 urllib3/1.26.18 CPython/3.10.12

File hashes

Hashes for torchlib_xpu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d456a81e8248092a161a6571e626b3bf85d678c5e8097a0b0073e00ff23a92c
MD5 4cc93d8de22f41cff14326ef75f8892c
BLAKE2b-256 f5a47a67b9d65b28559775f002f979cb7c37e15710ac062ccde0ff64b7d60efe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page