GPU computation - kschan0214/sepia GitHub Wiki
[20180827 update] The GPU feature does not work with the current file structure.
Some QSM processing algorithms utilise iterative approaches (e.g. pcg
, lsqr
, etc.) to obatain a
stable resulting map. To ensure convergence, one can be done is to increase the number of
iterations but the computation time will also be increasing. QSM Hub supports GPU computation in
Matlab. The GUI function will automatically detect the number of GPU devices available in local
computer (using gpuDeviceCount
). If the GPU device is detectable in Matlab, the GUI will provide
an option for user to choose using the GPU feature or not. Based on some preliminary testing, the
following methods will be benefical (and/or workable) with GPU computation:
- Projection onto dipole field (background field removal)
- Closed-form L2-regularisation (QSM)
- iLSQR (QSM)
- FANSI (QSM)
- Star (QSM)
- MEDI (QSM)
Caution
The performance of GPU computation is affected by not only the number of GPUs but also the RAM of
the GPU device. In principle, the input data of the methods will only be loaded onto the GPUs when
it is being called and the GPU device will be reset after the computation. However, the GPU
implementations could still be broken if the size of input data is large (e.g. large matrix size
data). The rule of thumb is that if you aim at a small iteration number (e.g. 30-50, except the
case of using MEDI), the performance of CPU and GPU computation will not have significant
differences (sometimes GPU may be even slower due to data distribution prior computation).
Nevertheless, if you are trying more iterations (i.e. >100), GPU computation usually gives you some
descent speed improvement.
This feature is only tested with the following system configuration:
- macOS High Sierra 10.13.4
- NVIDIA GeForce GT 750M
- Matlab R2018a
If it doesn't work on your system, you can simply disable (unchecked) the GPU option.