I am using Google GCP GPUs, and it appears the only machine image they provide is CUDA 11.0 (!). Only pytorch <= 1.7 supports CUDA 11.0.
I am creating a Dockerfile for my project. However, some of my library’s dependencies want pytorch 1.9, so they upgrade from pytorch 1.7 GPU version to pytorch 1.9 CPU version.
I think Pytorch 1.9 is a must. But then I am not sure what workaround is the least painful:

Can I use CUDA 10.2 in the Docker, even though the bare metal system is CUDA 11.0? Or will that cause problems. I have seen conflicting advice on this.
I could try to build my own Google machine image. This seems very painful tho.
I could try to build pytorch 1.9 from scratch in my Docker and use CUDA 11.0 in my Docker. I haven’t found good Dockerfiles explaining how to do this.

Any other suggestions?