Код: Выделить всё
A_sparse = torch.sparse_coo_tensor(indices, values, size=(eq_counter, self.num_regions))
A_sparse_csr = A_sparse.to_sparse_csr()
A_sparse_csr = A_sparse_csr.cuda()
# Create dense vector b
b = torch.tensor(b_values, dtype=slopes.dtype, device=slopes.device)
b = b.cuda()
# Solve the linear system A c = b using torch.sparse.spsolve
intercepts = torch.sparse.spsolve(A_sparse_csr, b) # Shape: (num_regions,)
/>У меня видеокарта серии Nvidia RTX 40, поэтому я не понимаю, почему сборка ROCm (связанная с графическими процессорами AMD) вообще актуальна/появляется в ошибке? Я попытался диагностировать ошибку с помощью следующего фрагмента кода:
Код: Выделить всё
print(f"PyTorch Version: {torch.__version__}")
print(f"CUDA Version: {torch.version.cuda}")
print(f"Is CUDA Available: {torch.cuda.is_available()}")
# Check the current CUDA device
if torch.cuda.is_available():
print(f"Current CUDA Device: {torch.cuda.current_device()}")
print(f"Device Name: {torch.cuda.get_device_name(torch.cuda.current_device())}")
Код: Выделить всё
PyTorch Version: 2.5.1+cu124
CUDA Version: 12.4
Is CUDA Available: True
Current CUDA Device: 0
Device Name: NVIDIA GeForce RTX 4090
Подробнее здесь: https://stackoverflow.com/questions/792 ... iling-pyto