Skip to content

Installing unigpu on Windows

Hardware Backends
NVIDIA GPU cuda; opencl on the same GPU
AMD (Radeon) or Intel GPU opencl
no GPU sim; opencl on the CPU through WSL 2 or conda (below)

The HIP backend (AMD) needs Linux: on Windows, AMD GPUs are used through OpenCL. The general steps are explained in INSTALL.md.

1. Python

Install Python 3.12 from python.org. In the first window of the installer, tick Add python.exe to PATH. Git is optional: Git for Windows, or the ZIP download below.

2. Code and virtual environment

In PowerShell (Start menu → Windows PowerShell):

git clone https://github.com/laveneau/unigpu.git
cd unigpu
py -3.12 -m venv .venv
.venv\Scripts\Activate.ps1           # again in every new terminal
python -m pip install --upgrade pip
pip install -e .                     # the simulator: enough to start
  • Without git: Code → Download ZIP on the page of the project, unzip it, then right-click in the folder → Open in Terminal (Windows 11; on Windows 10: Shift + right-click → Open PowerShell window here). More details: INSTALL.md.
  • If PowerShell refuses to run Activate.ps1 ("running scripts is disabled on this system"), allow the scripts of your account once:

    Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
    

    In the classic command prompt (cmd), activate with .venv\Scripts\activate.bat.

3. Your hardware

NVIDIA GPU

  1. An up-to-date NVIDIA driver: the one of the PC maker, or a Game Ready or Studio driver from nvidia.com. In PowerShell, nvidia-smi must show the GPU and CUDA Version: 12.0 or newer.
  2. Install the CUDA backend:

    pip install -e ".[cuda]"
    

    numba-cuda brings the CUDA libraries it needs: there is no CUDA toolkit to install. If nvidia-smi shows CUDA Version: 13.0 or newer, the cuda13 option installs those of CUDA 13 instead: pip install -e ".[cuda13]". CUDA 13 needs a GPU from the Turing generation (GeForce 16 and RTX 20) or newer.

  3. Optionally, OpenCL on the same GPU, provided by the same driver: pip install -e ".[opencl]".

AMD or Intel GPU

The graphics driver includes OpenCL: AMD Software: Adrenalin Edition for Radeon GPUs, the Intel graphics driver for integrated and Arc GPUs. Install the latest one, then:

pip install -e ".[opencl]"

Many Intel GPUs have no double precision: unigpu then treats Python floats as float32 (00_discovery.py shows float64: no).

No GPU

The simulator (installed in step 2) works. For real parallelism on the CPU, POCL (OpenCL on the CPU) is not distributed by pip for Windows. Two options:

  • WSL 2 (Linux inside Windows): wsl --install in an administrator PowerShell, restart, open Ubuntu, then follow the Linux page ("No GPU" section). CUDA also works in WSL 2 with the Windows NVIDIA driver; do not install a Linux NVIDIA driver inside WSL.
  • conda (Miniforge): in a conda environment, install PyOpenCL and POCL from conda-forge, then unigpu without option. Not tried yet.

    conda create -n unigpu -c conda-forge python=3.12 numpy pyopencl pocl
    conda activate unigpu
    pip install -e .
    

4. Check

python -m unigpu.selftest all
python examples\00_discovery.py

Every device must end with 11/11 checks passed.

Problems

In "Unavailable backends" or in the error What to do
python or py is not recognized reinstall Python and tick Add python.exe to PATH, or use py instead of python
opencl: PyOpenCL is not installed pip install -e ".[opencl]" in the activated environment
opencl: no OpenCL driver installed update the graphics driver; PyOpenCL finds the OpenCL drivers registered by Windows
cuda: numba-cuda is not installed pip install -e ".[cuda]" in the activated environment
cuda: CUDA unusable, or no GPU detected by the driver nvidia-smi must work: update the NVIDIA driver
hip: numba-hip is not installed expected on Windows: use opencl for an AMD GPU