megvii-model/CrowdDetection

Failed to request for multiple GPUs during inference

zehuichen123 opened this issue · 1 comments

test.py provides API for multi-GPUs testing. However, when I set -d 4, the program seems to request memory on only GPU 0 which leads to OOM.

11 16:42:50[mgb] ERR cudaMalloc failed while requesting 57933824 bytes (55.250MiB) of memory; error: out of memory(last_err=2(out of memory) device=0 mem_free=29.312MiB mem_tot=24220.312MiB)
11 16:42:50[mgb] could not allocate memory on device 0; try to gather free blocks from child streams, got 0.00MiB(0 bytes).

Have you met this problem before?

I solved it by setting os.environ for each process.