Hi ptrblck,
Thanks for your reply. After testing multiple settings of PyTorch and Cuda from conda install and docker (using the anibali/pytorch image) as well, I finally changed a GPU card and the errors disappeared. I mounted the GPU card to another machine, on which everything runs fine, and reproduced the error. So, I think it is the GPU card’s problem, but not due to PyTorch or other packages or contaminated environments.
BTW, I was suggested using this gpu-burn tool (https://github.com/wilicc/gpu-burn 1) to test if the GPU card is problematic. I used it and it works well. So, I just put it here for those who encounter similar errors.