import torch
torch.__version__ # '1.9.1+cu102'
A = torch.randn(2,3,3).cuda()
B = torch.randn(2,3,4).cuda()
X = torch.linalg.solve(A, B)
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
参考https://github.com/pytorch/pytorch/issues/60175说是torch版本问题
安装torch1.9.0版本就行