PyTorch* Prerequisites for Intel GPUs

ID 827139
Updated 8/2/2024
Version
Public

A newer version of this document is available. Customers should click here to go to the newest version.

author-image

By

PyTorch Prerequisites for Intel GPUs

These prerequisites let you compile and build PyTorch* 2.4 with optimizations for Intel Data Center GPUs. 

Developers compiling and building PyTorch 2.5 (for Intel Data Center and Client GPUs) should instead follow the prerequisite instructions for PyTorch 2.5.

Important: Read the Release Notes for the latest information and known issues about system requirements and support packages.

 

Build for Intel Data Center GPUs

These Intel Data Center GPUs are supported:

  • Intel® Data Center GPU Max Series platforms (formerly codename Ponte Vecchio or PVC)

These Linux releases are supported:

  • Red Hat* Enterprise Linux* 9.2
  • SUSE Linux Enterprise Server* 15 SP5
  • Ubuntu* Server 22.04 (>= 5.15 LTS kernel)

The following instructions show how to install:
 

  • Intel Data Center GPU Drivers along with compute and media runtimes and development packages

  • Intel GPU dependencies for PyTorch development package, which collects a subset of oneAPI components needed for building and running PyTorch.

Step 1: Install Intel Data Center GPU Drivers

The Data Center GPU Installation Instructions describe how to install software for Intel® Data Center GPU Max Series systems, along with compute and media runtimes and development packages. 
 

  1. Install the Intel GPU Drivers from the LTS Stream

    Use the instructions in the Linux OS-specific tabs within the Data Center GPU installation instructions for installing the Intel GPU drivers, based on the Linux distribution you're using. For PyTorch 2.4 the public LTS version is 803.61.  Be sure to follow all the instructions including adding your user to the render node group.

  2. Optional GPU Hardware Verification

    Optionally, follow these instructions to verify expected Intel GPU hardware is working.

Step 2: Install the Intel Development Support Package

After the Intel GPU drivers are installed, choose one of these ways to install the Intel development support package: either using a Linux package manager: APT, YUM, or Zypper, or using an offline installation script.  Note that installing the development support package assumes you don't already have existing oneAPI components installed.  You should uninstall them if you do.

Step 3: Set Up oneAPI Environment Variables

Before you use any oneAPI component installed by the PyTorch development bundle, use this command to configure environment variables, important folders, and command settings. :

source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh

If that command fails, you may have installed the PyTorch development bundle in your home directory, so try using this command instead:

source ~/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh

Optionally, if you installed this pytorch-gpu-dev-0.5 package on your system and there are no other versions of pytorch-gpu-dev or oneAPI components installed, you can also use this command to set up the development package environment.  This command will always activate the newest version of pytorch-gpu-dev or oneAPI components installed in the /opt/intel/oneapi/.directory:

source /opt/intel/oneapi/setvars.sh

 

Consider adding the source command to your ~/.bashrc file so it runs every time you log in or create a new shell session.

Where to go next?

After installing Intel GPU drivers and the support package, as shown above, you're ready to return to and continue following the upstream PyTorch instructions in the PyTorch Building from Source: Install Dependencies section.

Support

For support questions, look through or post a question to this oneAPI developer support forum.