MIC-DKFZ/HD-BET

Multi-GPU

vkyprmr opened this issue · 2 comments

Hi, firstly thanks for a great package. I wanted to know if I can somehow implement multiple gpus when available. I am not so familiar with pytorch, can you tell me if you are planning to make it a feature or can you help me with how i can integrate multiple gpus using existing scripts?

Hi Vicky,
there is no easy way to do that due to how HD-BET is implemented but you can use a simple workaround (my example is for 2 GPUs): just place 50% of the image in folder1 and the other 50 in folder2, then run hd-bet twice like this:

CUDA_VISIBLE_DEVICES=0 hd-bet -i folder1 -o folder1_out &
CUDA_VISIBLE_DEVICES=1 hd-bet -i folder2 -o folder2_out
wait

This will make the two predictions in parallel
Best,
Fabian

Thanks Fabian 😄