Training process get stuck with multiple GPUs
Issue summary
I use 8 GPUs to train VGG-19 with the latest master. After 103500 iterations, the training process get stuck. The nvidia-smi command shows as below:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 2070 Off | 00000000:1A:00.0 Off | N/A |
| 29% 49C P2 66W / 175W | 5422MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 2070 Off | 00000000:1B:00.0 Off | N/A |
| 29% 48C P2 66W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 2 GeForce RTX 2070 Off | 00000000:3D:00.0 Off | N/A |
| 29% 46C P2 68W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 3 GeForce RTX 2070 Off | 00000000:3E:00.0 Off | N/A |
| 29% 47C P2 61W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 4 GeForce RTX 2070 Off | 00000000:88:00.0 Off | N/A |
| 29% 45C P2 62W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 5 GeForce RTX 2070 Off | 00000000:89:00.0 Off | N/A |
| 29% 47C P2 63W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 6 GeForce RTX 2070 Off | 00000000:B1:00.0 Off | N/A |
| 29% 48C P2 64W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
| 7 GeForce RTX 2070 Off | 00000000:B2:00.0 Off | N/A |
| 29% 45C P2 63W / 175W | 3214MiB / 7952MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 18749 C caffe 5392MiB |
| 1 18749 C caffe 3184MiB |
| 2 18749 C caffe 3184MiB |
| 3 18749 C caffe 3184MiB |
| 4 18749 C caffe 3184MiB |
| 5 18749 C caffe 3184MiB |
| 6 18749 C caffe 3184MiB |
| 7 18749 C caffe 3184MiB |
+-----------------------------------------------------------------------------+
And htop command shows that 8 CPUs are fully occupied. The log is attached. log_vgg_19_20190401.txt
Does anyone know what cause this problem and how to solve it? Thank you!
Steps to reproduce
I ran the training process in a docker. The solver I used is as below:
net: "/data0/train/vgg19_half_256_224_bvlc/vgg_19_train_val.prototxt"
test_iter: 1563 # 50000/32
test_interval: 10000
test_initialization: false
display: 100
max_iter: 2400000 # 60 epocs B=32
base_lr: 0.005
lr_policy: "poly"
power: 2
momentum: 0.9
weight_decay: 0.0005
snapshot: 2400000
snapshot_prefix: "/data0/train/vgg19_half_256_224_bvlc/vgg19"
snapshot_after_train: true
solver_mode: GPU
random_seed: 1
And the mini-batch is 4. It is trained on 8 GPUs.
Tried solutions
I have tried different cuda version, with/without nccl, different ubuntu(16.04/18.04). I have also tried to start nvidia persistence service manually. It seems this problem not related to these factors.
I haved tried Pytorch and NVCaffe on the same machine. The problem doesn't happen.
System configuration
I ran training process with docker. The environment of the docker container is as below:
- Operating system: Ubuntu 16.04
- Compiler: GCC 5.4.0
- CUDA version (if applicable): 10.0
- CUDNN version (if applicable): 7.5.0
- BLAS: Atlas
solution: disable ACS https://github.com/NVIDIA/nccl/issues/199 https://devtalk.nvidia.com/default/topic/883054/cuda-programming-and-performance/multi-gpu-peer-to-peer-access-failing-on-tesla-k80-/2
Similar issues: https://github.com/facebookresearch/Detectron/issues/219 https://github.com/twitter/torch-ipc/issues/17