I think it’s best to use the official pytorch gpu image e.g. this:
https://hub.docker.com/layers/pytorch/pytorch/1.13.1-cuda11.6-cudnn8-runtime/images/sha256-1e26efd426b0fecbfe7cf3d3ae5003fada6ac5a76eddc1e042857f5d049605ee?context=explore
Just make sure that you’re not doing pip install pytorch again as that image already comes with Pytorch pre-installed with GPU set up, or you’ll be overriding it and potentially disable GPUs.