MIOpen icon indicating copy to clipboard operation
MIOpen copied to clipboard

[BUG] RuntimeError: miopenStatusUnknownError

Open caseclose opened this issue 3 years ago • 5 comments

I'm running a python file on DCU(using slurm to run on a Linux server). This python file runs well on another server with Nvidia GPUs. However, it shows this bug here in the deep-learning training log:

 Epoch: [1 | 300] LR: 0.100000
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [FindWinogradSolutions] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen Error: /MIOpen/src/ocl/convolutionocl.cpp:831: Forward Convolution cannot be executed due to incorrect params
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [FindWinogradSolutions] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen Error: /MIOpen/src/ocl/convolutionocl.cpp:831: Forward Convolution cannot be executed due to incorrect params
Traceback (most recent call last):
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 516, in <module>
Traceback (most recent call last):
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 516, in <module>
    main()
    main()
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 365, in main
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 365, in main
    train_loss, train_acc = train(trainloader, model, criterion, optimizer, epoch, use_cuda)
...
...
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 145, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 145, in forward
    x = self.layer2(x)  # 16x16
    x = self.layer2(x)  # 16x16
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/container.py", line 141, in forward
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/container.py", line 141, in forward
    input = module(input)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 77, in forward
    out = self.conv2(out)
    input = module(input)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 446, in forward
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 77, in forward
    out = self.conv2(out)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 446, in forward
    return self._conv_forward(input, self.weight, self.bias)
    return self._conv_forward(input, self.weight, self.bias)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
    return F.conv2d(input, weight, bias, self.stride,
RuntimeError: miopenStatusUnknownError
RuntimeError: miopenStatusUnknownError

and in the file /public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py, we can see what is in the function _conv_forward :

def _conv_forward(self, input: Tensor, weight: Tensor, bias: Optional[Tensor]):
        if self.padding_mode != 'zeros':
            return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),
                            weight, bias, self.stride,
                            _pair(0), self.dilation, self.groups)
        return F.conv2d(input, weight, bias, self.stride,
                        self.padding, self.dilation, self.groups)

def forward(self, input: Tensor) -> Tensor:
       return self._conv_forward(input, self.weight, self.bias)

caseclose avatar Feb 21 '23 17:02 caseclose

First please check if your issue is a duplicate of #1010.

Second, please make sure that your ROCm is installed on a system that meets all the requirements. Example for ROCm 5.4.3: https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.4.3/page/Prerequisites.html

If your system meets the requirements, we can try to help, but in order to do so, we need to reproduce the issue. Please be ready to provide reproduction instructions.

atamazov avatar Feb 22 '23 00:02 atamazov

I tried the method in #1010, however, when I tried to know the version of my MIOpen library or ROCm, it shows the following info:

$ yum info rocm-libs
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Error: No matching Packages to list

Is this info showing that I didn't install enough ralated library or other something? By the way, my OS is Linux 64. Thank you!

caseclose avatar Feb 22 '23 03:02 caseclose

Is this info showing that I didn't install enough ralated library or other something?

Likely it means "other something"

By the way, my OS is Linux 64.

"Linux 64" is not a name of Linux distribution.

MIOpen assumes that the user is familiar with the basics of Linux at least. I highly recommend improving your general Linux knowledge before contacting MIOpen team for further support.

atamazov avatar Feb 22 '23 09:02 atamazov

@cs-wangfeng @atamazov It looks like the user is using aliyun (Ali Cloud), we can treat it as RHEL.

https://www.alibabacloud.com/help/en/elastic-compute-service/latest/alibaba-cloud-linux-overview
Alibaba Cloud Linux 3 is built on Anolis OS 8 and compatible with the CentOS 8 and RHEL 8 ecosystems.
Alibaba Cloud Linux 2 is built on Anolis OS 7 and compatible with the CentOS 7 and RHEL 7 ecosystems.

@cs-wangfeng could you follow the installation instructions from here: https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.4.3/page/How_to_Install_ROCm.html choose proper RHEL guides which are suitable for your system. You may need to add the ROCm Stack Repository as instructed here: https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.4.3/page/How_to_Upgrade_ROCm.html

junliume avatar Feb 22 '23 16:02 junliume

I'm running a python file on DCU(using slurm to run on a Linux server). This python file runs well on another server with Nvidia GPUs. However, it shows this bug here in the deep-learning training log:

 Epoch: [1 | 300] LR: 0.100000
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [FindWinogradSolutions] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen Error: /MIOpen/src/ocl/convolutionocl.cpp:831: Forward Convolution cannot be executed due to incorrect params
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [ForwardBackwardDataGetWorkSpaceSizeWinograd] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen(HIP): Warning [FindWinogradSolutions] /MIOpen/src/sqlite_db.cpp:108: open memvfs: unable to open database file
MIOpen Error: /MIOpen/src/ocl/convolutionocl.cpp:831: Forward Convolution cannot be executed due to incorrect params
Traceback (most recent call last):
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 516, in <module>
Traceback (most recent call last):
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 516, in <module>
    main()
    main()
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 365, in main
  File "/public/home/bhli/MODEL/Random-Erasing/cifar_xh.py", line 365, in main
    train_loss, train_acc = train(trainloader, model, criterion, optimizer, epoch, use_cuda)
...
...
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 145, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 145, in forward
    x = self.layer2(x)  # 16x16
    x = self.layer2(x)  # 16x16
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/container.py", line 141, in forward
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/container.py", line 141, in forward
    input = module(input)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 77, in forward
    out = self.conv2(out)
    input = module(input)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 446, in forward
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/MODEL/Random-Erasing/models/cifar/resnet.py", line 77, in forward
    out = self.conv2(out)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 446, in forward
    return self._conv_forward(input, self.weight, self.bias)
    return self._conv_forward(input, self.weight, self.bias)
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
  File "/public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
    return F.conv2d(input, weight, bias, self.stride,
RuntimeError: miopenStatusUnknownError
RuntimeError: miopenStatusUnknownError

and in the file /public/home/bhli/.pyenv/versions/RandomErasing/lib/python3.9/site-packages/torch/nn/modules/conv.py, we can see what is in the function _conv_forward :

def _conv_forward(self, input: Tensor, weight: Tensor, bias: Optional[Tensor]): if self.padding_mode != 'zeros': return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode), weight, bias, self.stride, _pair(0), self.dilation, self.groups) return F.conv2d(input, weight, bias, self.stride, self.padding, self.dilation, self.groups)

def forward(self, input: Tensor) -> Tensor: return self._conv_forward(input, self.weight, self.bias)

I encountered the same problem. May I ask if you have solved it? Thanks!

GexLoong avatar May 08 '25 13:05 GexLoong