I found that we can just install pytorch or tensorflow using pip without CUDA-toolkit runtimes from nvidia or linux package manager.
pytorch
tensorflow
pip