GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • diffct
  • Getting Started
  • User Guide
  • Examples
  • API Reference
  • Changelog
  • GitHub
  • PyPI
  • Installation
  • Quickstart
  • Trajectories and Geometry
  • Precision, training and reconstruction
  • Large Volumes and Chunked Execution
  • Multiple GPUs and Nodes

This view

  • Original page
  • New address

GeezerVison is showing sypsyp97.github.io — Installation — diffct 2.5.2

Installation#

Native execution uses an NVIDIA CUDA GPU. The portable PyTorch backend also supports CPU, PyTorch ROCm and Apple Silicon (MPS) devices; see Precision, training and reconstruction for precision and hardware-validation limits.

diffct needs Python 3.10 or newer, and a Python version for which PyTorch publishes wheels. Install PyTorch for your device first. Then print the CUDA version of your PyTorch build:

python -c "import torch; print(torch.version.cuda)"

Install diffct with the extra that matches this version. The extra installs the CUDA compiler libraries that Numba CUDA needs.

13.x
pip install "diffct[cu13]"
12.x
pip install "diffct[cu12]"
None (CPU, ROCm or MPS)
pip install diffct

Use backend="torch". Importing diffct and using this backend require no CUDA runtime.

From source
git clone https://github.com/sypsyp97/diffct.git
cd diffct
pip install -e ".[cu13]"    # or ".[cu12]", or "." without CUDA
python examples/quickstart.py

Most scripts in examples/ need an NVIDIA GPU; plot_trajectory.py and benchmark_trajectory_admission.py --backend torch run on CPU.

Check the installation:

python -c "import torch, diffct; print(diffct.__version__); print(torch.cuda.is_available())"

Numba CUDA initializes on native use. The NVVM and NVJitLink packages must match the CUDA libraries that PyTorch loads, so the extra must match torch.version.cuda. A plain pip install diffct also works for native execution if a matching CUDA Toolkit is already installed.

Troubleshooting#

  • CUDA is unavailable: check that the active Python environment has a CUDA build of PyTorch and that the GPU is visible to the process.

  • NumPy 2.5 compatibility: Numba CUDA imports numpy.row_stack, which NumPy 2.5 removes. Keep numpy<2.5 until Numba CUDA no longer needs it.

  • Kernel compilation fails: use Numba CUDA, NVVM and NVJitLink versions that match each other. Do not upgrade only one of them.

  • nvJitLink error: nvJitLinkError with “may need newer version of nvJitLink library” means that the diffct extra does not match the CUDA version of PyTorch. Print torch.version.cuda and reinstall with diffct[cu12] for 12.x or diffct[cu13] for 13.x.

Tested CUDA combinations#

  • CUDA 13: pip install "numpy<2.5" "numba-cuda[cu13]" "cuda-toolkit[cccl,cudart,nvrtc,nvvm]==13.0.2" "nvidia-nvjitlink<13.1"

  • CUDA 12: PyTorch 2.10 (cu126) with numba-cuda[cu12] 0.30.4 on NVIDIA driver 535.

On this page
Edit on GitHub
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.