Experimenting with PyTorch on Intel architecture
Find a file
2025-09-02 21:05:58 +02:00
.gitignore initial commit 2025-09-02 20:09:03 +02:00
main.py initial commit 2025-09-02 20:09:03 +02:00
README.md chore: update readme 2025-09-02 21:05:58 +02:00

Learn PyTorch

Code experimenting with PyTorch using Intel architecture (i.e., Intel Core Ultra processor with iGPU) or xpu.

After installing ipex-llm which is required to use Intel GPUs (see documentation in Links), you can should have access to conda and be able to import torch normally.

Setup

  1. Activate the conda environment
conda activate llm-pt26
  1. Set the necessary environmental variables:
unset OCL_ICD_VENDORS
export SYCL_CACHE_PERSISTENT=1
export SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1
  1. (Optional) Confirm if XPU is detected
$ python # go intou the python shell

$ import torch
$ torch.xpu.is_available()
$ torch.xpu.get_device_name()

Links