Skip to content

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 ​

ComponentMinimumRecommendedNotes
Python3.103.11Required for typed config validation
PyTorch2.3.02.5.1torch.compile requires 2.4+
CUDA Toolkit11.812.4Required for BF16 & Flash Attention kernels
ONNX Runtime1.181.20Use onnxruntime-gpu for CUDA EP
TensorRT10.010.6Optional; 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 sorasr

To 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 doctor

Example 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       : OK

Container 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"]

Released under the Apache-2.0 License.