Thank you for your assistance!
We have solved the problem.
There are two nvidia drivers.
So we delete one and reinstall pytorch, and then torch.cuda.is_available() becomes true.
Hope it’s helpful to others.