Can't run torch conv2d with AMD Instinct MI250X

I am on AMD 250X GPU after installed rocm5.6 with pytorch version 2.2 following commend

 pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/rocm5.6

I am not able to run the test code:

import torch

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
x = torch.rand(1, 3, 64, 64, device=device)  # Random tensor
conv = torch.nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1).to(device)
y = conv(x)
print(y.shape)

error:

MIOpen(HIP): Warning [FindWinogradSolutions] /MIOpen/src/sqlite_db.cpp:220: Internal error while accessing SQLite database: disk I/O error
MIOpen(HIP): Warning [FindDataGemmSolutions] /MIOpen/src/sqlite_db.cpp:220: Internal error while accessing SQLite database: disk I/O error
MIOpen(HIP): Warning [FindDataDirectSolutions] /MIOpen/src/sqlite_db.cpp:220: Internal error while accessing SQLite database: disk I/O error
MIOpen(HIP): Warning [FindDataImplicitGemmSolutions] /MIOpen/src/sqlite_db.cpp:220: Internal error while accessing SQLite database: disk I/O error
MIOpen(HIP): Warning [FindFftSolutions] /MIOpen/src/sqlite_db.cpp:220: Internal error while accessing SQLite database: disk I/O error
MIOpen Error: /MIOpen/src/ocl/convolutionocl.cpp:517: Forward Convolution cannot be executed due to incorrect params
Traceback (most recent call last):
....
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: miopenStatusUnknownError

However I don’t have issue with AMD 210X GPU.

Hey @lbj_obj ,
This issue doesn’t appear to be related to the GPU’s that you’re using.
Specifically, the error

Internal error while accessing SQLite database: disk I/O error

suggests there’s an issue with the filesystem where MIOpen is attempting to create an sqlite database.

Can you confirm that you have sufficient space on the disk or file system that hosts your /home directory ?

df -h

MIOpen, by default, will use ~/.cache/miopen for storing pre-compiled kernels and other performance related information. Can you confirm this path exists and you have permissions to read/write there.

ls -l ~/.cache/
ls -l ~/.cache/miopen/

Alternatively, can you confirm that the environment variable MIOPEN_CACHE_DIR is not set

echo $MIOPEN_CACHE_DIR

If it is set to some path, make sure that you have read/write access to that location ?