RuntimeError: Unexpected error from cudaGetDeviceCount()

I don’t know the differences between your local run and the docker one, but the same error was fixed here by reinstalling the NVIDIA driver.