CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Using multiple GPUs with Python

Open fcivardi opened this issue 9 years ago • 4 comments

I'm using CNTK with Python, on a NC24 Azure Machine (4 GPUs K80). What should I do to use all 4 GPUs? Simply : mpiexec -n 4 python training.py ? What should I put in training.py? Do I need a distributed learner? with 1 GPU I have, in training.py from cntk.device import set_default_device, gpu set_default_device(gpu(0)) with more GPUs? Thanks, Francesco

fcivardi avatar Dec 27 '16 21:12 fcivardi

You can follow this example. If you have installed the CUDA drivers correctly it should work. You'll see if it is using all the GPUs with the command: watch nvidia-smi

miguelgfierro avatar Dec 29 '16 12:12 miguelgfierro

Thanks. Does "watch nvidia-smi" work on Windows?

fcivardi avatar Dec 29 '16 14:12 fcivardi

It won't. However you should have a nvidia-smi.exe

miguelgfierro avatar Dec 29 '16 17:12 miguelgfierro

More information about different distributed modes can be found here: https://github.com/Microsoft/CNTK/wiki/Multiple-GPUs-and-machines

I'm closing the issue for now, feel free to reopen if you bump into any issues. Thanks!

eldakms avatar Jan 02 '17 08:01 eldakms