Bug 98007 - ASSERTION FAILED: sel.hasDoubleType()
Summary: ASSERTION FAILED: sel.hasDoubleType()
Status: RESOLVED MOVED
Alias: None
Product: Beignet
Classification: Unclassified
Component: Beignet (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Xiuli Pan
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-01 18:20 UTC by Bryan Mason
Modified: 2018-10-12 21:25 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Log File (1.15 MB, text/plain)
2016-10-11 04:19 UTC, Bryan Mason
Details

Description Bryan Mason 2016-10-01 18:20:48 UTC
Description of problem:

ASSERTION FAILED: sel.hasDoubleType()
  at file /builddir/build/BUILD/Beignet-1.2.0S ource/backend/src/backend/gen_insn_selection.cpp, function void gbe::ConvertInstructionPattern::convertBetweenFloatDouble(gbe::Selection::Opaque&, const gbe::ir::ConvertInstruction&, bool&) const, line 5100

Version-Release number of selected component (if applicable):

    beignet-1.2.0-1.fc24.x86_64

How reproducible:

    100%

Steps to Reproduce:

 1. Start AfterShotPro3X64 from Corel

Actual results:

    Failure/Core Dump

Expected results:

   Joy and happiness without a core dump

Additional info:

    Downgrading to beignet-1.1.1-2.fc24.x86_64 resolves the issue.

    Issue has also been reported to Fedora:
    https://bugzilla.redhat.com/show_bug.cgi?id=1380941
Comment 1 Bryan Mason 2016-10-01 18:22:30 UTC
I believe that this may be similar to, but separate from, Bug 93076
Comment 2 Xiuli Pan 2016-10-11 03:23:29 UTC
Hi Bryan,
Could you provide the LLVM version you are using? And the where I can get this AfterShotPro3X64 from Corel? It seems it is not an open source software.
And could you provide the logs with run the AfterShotPro3X64 with

OCL_OUTPUT_KERNEL_SOURCE=1 OCL_OUTPUT_LLVM_AFTER_GEN=1 OCL_OUTPUT_GEN_IR=1 OCL_OUTPUT_SEL_IR=1 ./AfterShotPro3X64 

Thanks
Xiuli
Comment 3 Bryan Mason 2016-10-11 04:17:36 UTC
(In reply to Xiuli Pan from comment #2)
> Could you provide the LLVM version you are using? 

I'm not sure how to determine this, but I'm happy to run any commands to find out.  FWIW, I'm running Fedora 24.

> And the where I can get
> this AfterShotPro3X64 from Corel? It seems it is not an open source software.

Yes, sadly it's not open source.  Trial copies can be downloaded from:

http://www.aftershotpro.com/en/free-trials/?sourceid=asp3-xx-ppc_brkws

> And could you provide the logs with run the AfterShotPro3X64 with
> 
> OCL_OUTPUT_KERNEL_SOURCE=1 OCL_OUTPUT_LLVM_AFTER_GEN=1 OCL_OUTPUT_GEN_IR=1
> OCL_OUTPUT_SEL_IR=1 ./AfterShotPro3X64 

Sure.  I'm assuming you want everything that's printed to stdout?
Comment 4 Bryan Mason 2016-10-11 04:19:02 UTC
Created attachment 127203 [details]
Log File

Output of the following command:

OCL_OUTPUT_KERNEL_SOURCE=1 OCL_OUTPUT_LLVM_AFTER_GEN=1 OCL_OUTPUT_GEN_IR=1 OCL_OUTPUT_SEL_IR=1 AfterShot3X64 > asp.log

If you'd like me to redirect stderr as well, just let me know.
Comment 5 Xiuli Pan 2016-10-11 06:05:29 UTC
(In reply to Bryan Mason from comment #4)
> Created attachment 127203 [details]
> Log File
> 
> Output of the following command:
> 
> OCL_OUTPUT_KERNEL_SOURCE=1 OCL_OUTPUT_LLVM_AFTER_GEN=1 OCL_OUTPUT_GEN_IR=1
> OCL_OUTPUT_SEL_IR=1 AfterShot3X64 > asp.log
> 
> If you'd like me to redirect stderr as well, just let me know.

I have got the LLVM and clang version from the log.
!0 = !{!"clang version 3.8.0 (tags/RELEASE_380/final)"}
This bug is a known issue caused by clang.
Clang now will take all immediate float value as double precise float value, like 1.0 will be treated as a double float 1.0, and it will cause all other value in the function to be expanded to double:
kernel cl source:
  lumaBlur = lumaBlur * 0.01;
llvm ir:
  %171 = fpext float %170 to double
  %172 = fmul double %171, 1.000000e-02
  %173 = fptrunc double %172 to float

I see all other value has suffix f like 0.f, I think if you can change the line lumaBlur = lumaBlur * 0.01;
in kernel rgbSharpen_PlanarLds into
lumaBlur = lumaBlur * 0.01f;
the problem should be solved.

This bug is caused by the clang, and we could not workaround it from the backend. If you can change the kernel of AfterShotPro3X64, you can try to fix this problem or report a bug to AfterShotPro.

You can also use some older llvm like llvm3.6, this bug is also in llvm3.7.
The bug related commit is http://reviews.llvm.org/rL227565, you can also workaround this bug by revert this commit in llvm and rebuild and install the llvm.

Thanks
Xiuli
Comment 6 Bryan Mason 2016-10-13 16:53:22 UTC
I've opened a support case with Corel/AfterShotPro to try and get this resolved.  

Thanks for your help!
Comment 7 GitLab Migration User 2018-10-12 21:25:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/beignet/beignet/issues/51.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.