Hi everyone,
I installed Spinal Cord Toolbox with the GPU version of PyTorch, but when running sct_deepseg
, I don’t see any speed improvement compared to the CPU version. The output shows:
Running TotalSpineSeg with the following parameters:
input = "/tmp/sct_2025-05-28_11-16-35_sct_deepseg_q1cvopuq/t1_spinal.nii.gz"
output = "/tmp/sct_2025-05-28_11-16-35_sct_deepseg_q1cvopuq/nnUNet_prediction"
iso = False
loc = "None"
suffix = ['']
loc_suffix = ""
step1_only = False
data_dir = "/usr/local/sct_v7.0_cuda/data/deepseg_models/totalspineseg"
max_workers = 1
max_workers_nnunet = 1
device = "cpu"
Why is it still using the CPU? How can I enable GPU computation?
Thanks in advance!
Best,
Xiaomin
Dear @Xiaomin_Lin,
The GPU installation is experimental, and was originally intended just for our internal researchers while we test the feature. So, the feature is a bit hidden (by design). To help keep it hidden, we added an additional setting that is required to enable GPU computation.
To enable GPU, you must add SCT_USE_GPU=1
before any commands you run. More details can be found on this page of our internal developer Wiki.
Thank you for your curiosity, and for trying out this experimental feature. 
Kind regards,
Joshua
Dear Joshua,
Thank you so much for your clear instructions. I’m happy to report that I’ve successfully run my code with GPU here. If I encounter any issues or odd behaviors during testing, I’ll be sure to let you know right away.
Thanks again for making this experimental feature available!
Best,
Xiaomin
1 Like