MATLAB: When using multiple GPU’s get out of memory error at less than max single GPU memory x number GPUS

gpu memory parallel

Running a blockproc operation on a large image.
When I use a single GPU I can process a tilesize of 1024×1024 without running out of memory using about 11.5 of 12GB GPU memory.
Using multiple GPU ('UseParallel', true) I get out of memory errors at anything above 640×640 tile size with similar utilization of about 11.5 of 12GB of memory per GPU.
Not sure why this should be the case?

Best Answer

Make sure your default parallel pool only opens one worker per GPU, otherwise many workers will all try to share the same GPU, hence each will have less memory to work with.
Related Question