Running Topaz with Blackwell GPUs like RTX 5090 or RTX Pro 6000

I saw a couple of threads about running Topaz with Blackwell GPUs. Here is a working recipe for installing Topaz 0.3.18 that works with CryoSparc5 and Cuda12.8 that is required for Blackwell GPUs.
One important note; you cannot use training model from Topaz 0.2.5 as some of the classes are renamed, attributes missing and not back compatible. There is a workaround where you need to modify two installation files below.
topaz3/lib/python3.11/site-packages/topaz/model/features/resnet.py
topaz3/lib/python3.11/site-packages/topaz/model/classifier.py
Let me know if this recipe works for you and if you need to know how to modify the files above.

Installation Instructions for Topaz 0.3.18 with Cuda12.8

conda create -n topaz3 python=3.11 -y
conda activate topaz3

conda install -y \
-c tbepler -c conda-forge -c pytorch \
numpy=1.26.4 \
scipy=1.11.4 \
pandas=1.5.3 \
scikit-learn=1.3.2 \
h5py=3.11.0 \
pillow=10.4.0 \
tqdm=4.66.5 \
future=0.18.3 \
joblib=1.3.2 \
python-dateutil=2.8.2 \
pytz=2024.1

pip install topaz-em==0.3.18 --no-deps

pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 \
–index-url https://download.pytorch.org/whl/cu128

#Test installation

topaz --version
python -c “import torch; print(torch.version); print(‘CUDA:’, torch.cuda.is_available()); print(torch.cuda.get_device_name(0))”

2 Likes