Tohrusky/Final2x

[Bug] Cannot execute by AMD Vega integrated GPU

koushitw opened this issue · 5 comments

Please carefully review each item in the checklist below | 请认真检查以下清单中的每一项 | 以下のチェックリストの各項目を注意深く確認してください

  • Searched and didn't find a similar issue | 已经搜索过,没有发现类似issue | 類似の問題が見つかりませんでした
  • Searched documentation and didn't find relevant content | 已经搜索过文档,没有发现相关内容 | ドキュメントを検索して関連する内容が見つかりませんでした
  • Tried with the latest version and the issue still exists | 已经尝试使用过最新版,问题依旧存在 | 最新バージョンを試しましたが問題は解消されませんでした

Software Version | 软件版本 | ソフトウェアバージョン

1.1.5

Operating System | 操作系统 | オペレーティングシステム

Windows x64

System Version | 系统版本 | システムバージョン

Windows 10 x64 1909

Describe the bug | 描述错误 | BUGの説明

All the modules I can use properly on CPU only; the GPU-vulkan-based modules always report error messages.
I am using AMD 5700G with Vega 5000 iGPU supporting Vulkan-API up to 1.3.
the graphic driver is the latest adrenalin 23.11.1.

i have the same problem with AMD 2400G iGPU, Vega 11.

I have allocated iGPU with 4GB shared RAM.

To reproduce | 复现步骤 | 再現方法

  1. run final2x
  2. select any pictures with JPG/PNG formats
  3. choose [GPU0] AMD Radeon Graphics
  4. set RealESRGAN as an executive module.
  5. run, error posted during initiation steps.

Error log | 报错日志 | ログ

[{"label":"CPU: Ryzen 7 5700G with Radeon Graphics","value":-1},{"label":"GPU 0: AMD Radeon(TM) Graphics","value":0},{"label":"GPU: Auto","value":114514}]
{"gpuid":0,"inputpath":["C:\\Users\\user\\Desktop\\9545a7303c098c0f972f6a16f81livb5.JPG"],"model":"RealESRGAN","modelscale":4,"modelnoise":0,"outputpath":"C:\\Users\\user\\Desktop","targetscale":0,"tta":true}
2023-12-21 16:06:45.099 | INFO     | __main__:main:58 - projectPATH: C:\Users\user\AppData\Local\Programs\Final2x\resources\app\resources\Final2x-core
2023-12-21 16:06:45.100 | INFO     | __main__:main:71 - config loaded
2023-12-21 16:06:45.105 | INFO     | src.SRFactory.SRBaseClass:_set_sr_n:53 - sr_n set to 1
2023-12-21 16:06:45.105 | INFO     | src.SRFactory.SRBaseClass:__init__:35 - SRBaseClass init
[0 AMD Radeon(TM) Graphics]  queueC=1[2]  queueG=0[1]  queueT=2[1]
[0 AMD Radeon(TM) Graphics]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 AMD Radeon(TM) Graphics]  fp16-p/s/a=1/1/1  int8-p/s/a=1/1/1
[0 AMD Radeon(TM) Graphics]  subgroup=64  basic=1  vote=1  ballot=1  shuffle=1
2023-12-21 16:06:48.681 | INFO     | src.SRFactory.REALESRGAN:_init_SR_class:66 - RealESRGAN model loaded
2023-12-21 16:06:48.681 | INFO     | src.SRqueue:SR_queue:25 - Processing------[ 0.0% ]
2023-12-21 16:06:48.717 | INFO     | src.SRqueue:SR_queue:73 - Processing: C:\Users\user\Desktop\9545a7303c098c0f972f6a16f81livb5.JPG, save to: C:\Users\user\Desktop\outputs\4x-9545a7303c098c0f972f6a16f81livb5.png
vkAllocateMemory failed -2
2023-12-21 16:06:48.804 | ERROR    | src.SRFactory.SRBaseClass:process:78 - An error has been caught in function 'process', process 'MainProcess' (22824), thread 'MainThread' (37964):
Traceback (most recent call last):
File "__main__.py", line 88, in <module>
File "__main__.py", line 79, in main
File "src\SRqueue.py", line 74, in SR_queue
> File "src\SRFactory\SRBaseClass.py", line 78, in process
File "src\SRFactory\SRBaseClass.py", line 96, in _process_n
File "realesrgan_ncnn_py\realesrgan_ncnn_vulkan.py", line 188, in process_cv2
File "realesrgan_ncnn_py\realesrgan_ncnn_vulkan.py", line 122, in process
RuntimeError: Caught an unknown exception!
Traceback (most recent call last):
File "__main__.py", line 88, in <module>
File "__main__.py", line 79, in main
File "src\SRqueue.py", line 84, in SR_queue
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:1109: error: (-215:Assertion failed) !image.empty() in function 'cv::imencode'
[22824] Failed to execute script '__main__' due to unhandled exception!
CLOSE CODE:1

Additional context | 附加内容 | 追加コンテキスト

No response

Will it work fine with native-gpu or gpu-pass-through?

Will it work fine with native-gpu or gpu-pass-through?

many thanks for your quick reply.

These devices I mentioned only contains an integrated Vega GPU.
I have another PC with only AMD RX570 4GB graphic card working fine.

Actually, I am encountering the same problem with a similar application called 'Upscayl*'. But some users said it works fine with miniPC, with 5900H APU (that is mobile version of 5700G)

  • using some open modules that is identical to Final2X contained.

Will it work fine with native-gpu or gpu-pass-through?

many thanks for your quick reply.

These devices I mentioned only contains an integrated Vega GPU. I have another PC with only AMD RX570 4GB graphic card working fine.

Actually, I am encountering the same problem with a similar application called 'Upscayl*'. But some users said it works fine with miniPC, with 5900H APU (that is mobile version of 5700G)

  • using some open modules that is identical to Final2X contained.

Certainly
It seems like you're dealing with an issue that comes from upstream
Try use this cli app - https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan
And Not surprisingly, you'll get the same error

Try switching the ncnn library and the vulkan lib version to compile may work, I can provide some tech support for compiling it...

https://final2x.tohru.top/pages/build/xx-ncnn-py.html

The steps for compiling the cli are similar. Try using the latest ncnn and vulkan-lib version...

Hello! your issue has been closed because it has been inactive for a long time.

你好,你的 issue 因为长时间不活跃而被自动关闭。

こんにちは、お問い合わせは長期間活動がないため、閉じられました。