GPUOpen-LibrariesAndSDKs / Orochi

MIT License
204 stars 32 forks source link

Issues running some HIPRT SDK samples.. #21

Closed oscarbg closed 2 years ago

oscarbg commented 2 years ago

Hi, sorry for asking here.. but just testing HIPRT SDK and seems uses Orochi which is nice.. as seems HIPRT is supported on RX Vega (not using HW raytracing in this case) I'm testing on RX Vega on Windows with driver 22.4.1.. seems I get working: 00_context_creation64 01_geom_intersection64 02_scene_intersection64 03_custom_intersection but: 04_shared_stack64.exe,05_custom_bvh_import64,10_motion_blur64 fail with the same error:

executing on Radeon RX Vega
Error: COMGR fails to add headers into inputs.

running from insider Visual Studio I get more info:

In file included from C:\Users\rtfss\AppData\Local\Temp\comgr-70b603\input\CompileSource:24:
C:\Users\rtfss\AppData\Local\Temp\comgr-70b603\include\hiprt/hiprt_device.h:1:1: error: source file is not valid UTF-8
<FF>
^
1 error generated when compiling for gfx900.
Error: Failed to compile source (from CL or HIP source to LLVM IR).

mention also 06_obj_AO64.exe also causes a Windows TDR crash and graphics driver is reset..

hope any of this bugs is not related to previous bug I mentioned on using printf on kernels failed on Orochi on my system..

oscarbg commented 2 years ago

more findings: sorry for mentioning error:

executing on Radeon RX Vega
Error: COMGR fails to add headers into inputs.

it was due to not finding hiprt_device.h when running from command line.. still error:

In file included from C:\Users\rtfss\AppData\Local\Temp\comgr-70b603\input\CompileSource:24:
C:\Users\rtfss\AppData\Local\Temp\comgr-70b603\include\hiprt/hiprt_device.h:1:1: error: source file is not valid UTF-8
<FF>
^
1 error generated when compiling for gfx900.
Error: Failed to compile source (from CL or HIP source to LLVM IR).

in the samples apply.. one simple fix I find is to comment //#include <hiprt/hiprt_device.h> in TestKernel.h of this 04, 05 and 10 samples.. as seems TestBase::buildTraceProgram includes readSourceCode( path, sourceCode, &includeNamesData ); which includes the #included files already.. with that these samples work (at least they run to completion and generate png files..)

now comparing the generated images to what it's shown in hiprtSdk-main\tutorials\imgs pngs I see some differ which may show a bug: scene 2: 1 triangle shown only 02_scene_intersection scene 3: only 2 speheres shown: 03_custom_intersection scene 4: only 2/3 triangles instead of complete cornell box scene 04_shared_stack

hope can share how to fix rendering bugs..

thanks..

oscarbg commented 2 years ago

Hi, good news.. tested on a new AMD preview driver (30.0.21001.1004 22.10.01.01-220412a) and all samples work/render correctly on RX Vega with the simple fix: //#include <hiprt/hiprt_device.h> in TestKernel.h so I close now..