Appearance
Installation
SoraSR targets Python 3.10–3.12 and PyTorch 2.3+. CPU execution is supported for unit testing and small-image prototyping, while CUDA 12.1+ is recommended for training and high-throughput inference.
Compatibility Matrix
| Component | Minimum | Recommended | Notes |
|---|---|---|---|
| Python | 3.10 | 3.11 | Required for typed config validation |
| PyTorch | 2.3.0 | 2.5.1 | torch.compile requires 2.4+ |
| CUDA Toolkit | 11.8 | 12.4 | Required for BF16 & Flash Attention kernels |
| ONNX Runtime | 1.18 | 1.20 | Use onnxruntime-gpu for CUDA EP |
| TensorRT | 10.0 | 10.6 | Optional; required only for .engine builds |
Install via uv or pip
Create an isolated virtual environment and install PyTorch matching your CUDA driver first:
bash
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu124
uv pip install sorasrTo enable ONNX export, perceptual metrics (lpips), and fast dataset caching:
bash
uv pip install "sorasr[export,metrics]"Editable Source Install
For modifying architectures or adding custom degradation operators:
bash
git clone https://github.com/sorasr-project/sorasr.git
cd sorasr
uv pip install -e ".[dev,export,metrics]"Verify the Environment
Run the built-in diagnostic command to confirm GPU visibility, precision support, and operator availability:
bash
sorasr doctorExample healthy output:
text
Python : 3.11.9
PyTorch : 2.5.1+cu124
CUDA Device : NVIDIA L40S (46.0 GB)
BF16 Support : True
ONNX Runtime : 1.20.1 (CUDAExecutionProvider)
TensorRT : 10.6.0
Status : OKContainer Image
A minimal reproducible Dockerfile pattern for CI or cluster workers:
dockerfile
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3-pip libgl1 libglib2.0-0 && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir torch torchvision sorasr[export]
ENTRYPOINT ["sorasr"]