解决RuntimeError:CUDAerror:nokernelimageisavailableforexecutiononthedeviceCUDAkernelerrorsmightbeasynchronouslyreportedatsomeotherAPIcall,sothestacktracebelowmightbeincorrect.在服务器复现代码的时候,遇到了上述错误,解决办法如下。问题描述:nvidia-smi下的GPU编号与Pytorch上的不同可能原因:nvidia-smi的gpu编号默认使用的是PCI_BUS_ID,而Pytorch默认的是FASTEST_FIRST解决方