ahendriksen / tomosipo

A library for painless 3D tomographic reconstruction
https://aahendriksen.gitlab.io/tomosipo/index.html
GNU General Public License v3.0
83 stars 16 forks source link

Tomosipo without CUDA in CI/CD Environment? #20

Closed Evidlo closed 1 year ago

Evidlo commented 1 year ago

My group has a pipeline that runs tests on a build server. It would be nice to be able to use Tomosipo in this environment without installing CUDA. Is this possible?

[evan@blackbox ~] /tmp/Miniconda3-latest-Linux-x86_64.sh
[evan@blackbox ~] source ~/tmp/miniconda/bin/activate
(base) [evan@blackbox ~] conda create -n tomosipo
(base) [evan@blackbox ~] conda activate tomosipo
(tomosipo) [evan@blackbox ~] conda install tomosipo -c astra-toolbox -c aahendriksen -c defaults

/tmp/test.py

import tomosipo as ts
import numpy as np

vg = ts.volume(shape=(32, 32, 32), size=(1, 1, 1))
pg = ts.parallel(angles=32, shape=(48, 48), size=(1.5, 1.5))
A = ts.operator(vg, pg)
x = np.ones(A.domain_shape, dtype=np.float32)
y = A(x)
(tomosipo) [evan@blackbox ~] python /tmp/test.py                                                                      
Warning: Unable to get available GPU memory. Defaulting to 1GB.
Error: maxBlockDimension getDevice: CUDA error 35: CUDA driver version is insufficient for CUDA runtime version.
Warning: Error querying device                                                                                        
Floating point exception                                                                                              
Evidlo commented 1 year ago

For example, I have no problem running ASTRA's s004_cpu_reconstruction.py example without CUDA installed.

(tomosipo) [evan@blackbox tmp] python /tmp/s004_cpu_reconstruction.py 
D1rk123 commented 1 year ago

Tomosipo internally only uses the 3D geometries from Astra, and the 3D geometries are only available using CUDA. There are no parts of Tomosipo currently using the 2D CPU geometries and enabling them would require large changes to the core of Tomosipo. Therefore I'm afraid I can't help you. If you have other requests or bugs later, feel free to let me know.