When running a GPU-enabled docker container on an EC2 p2.xlarge instance I experience a delay of between 30 and 90 seconds before the container starts running. Subsequent containers start fast (1 second delay).
The EC2 is running ubuntu 18.04 with NVIDIA driver version 396.54 and nvidia-docker2 (following the official installation guide: https://github.com/NVIDIA/nvidia-docker)
I am testing using the latest official CUDA image: docker run --rm nvidia/cuda nvidia-smi
Persinstence mode is enabled on my machine. As stated in https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver under "Why is my container slow to start with 2.0?" it should be the solution, but doesn't work for me.
Any ideas what might be causing the delay and how to fix it are appreciated.