dcompute icon indicating copy to clipboard operation
dcompute copied to clipboard

Assertion `originalLType->isStructTy()' failed

Open mneilly opened this issue 6 years ago • 6 comments

I ran across dcompute and thought I would give it a try. What is the combination of dcompute and ldc that is expected to work? I have tried ldc 1.4.0 thru 1.15 with dcompute 0.1.0 and master and have not found a combination that works when I try "dub test dcompute".

Depending upon the combination I get different errors including:

../../../.dub/packages/dcompute-master/dcompute/source/dcompute/driver/error.d(165,43): Error: non-constant nested delegate literal expression __lambda9

../../../.dub/packages/dcompute-0.1.0/dcompute/source/dcompute/driver/error.d(143,13): Error: undefined identifier fprintf             
                                                                             
../../../.dub/packages/dcompute-0.1.0/dcompute/source/dcompute/driver/ocl/context.d(144,19): Error: undefined identifier clCreateProgramWithIL 

master/dcompute/source/dcompute/tests/main.d(106): Enforcement failed                            

ldc2: /home/vsts/work/1/s/gen/abi-x86-64.cpp:303: void X86_64TargetABI::rewriteArgument(IrFuncTy&, IrFuncTyArg&, {anonymous}::RegCount&): Assertion `originalLType->isStructTy()' failed.                                                                                        

/usr/local/ldc2-1.13.0-beta2-linux-x86_64/bin/../import/std/array.d(2975,13): Error: TypeInfo cannot be used with -betterC

mneilly avatar Mar 25 '19 00:03 mneilly

Try with the latest LDC beta.

thewilsonator avatar Mar 25 '19 00:03 thewilsonator

Unfortunately, I cannot get that to work either as it gets the 'enforcement failed error'.

(ldc-1.15.0-beta2)$ dub test dcompute --compiler=ldc2
Building package dcompute in /home/mneilly/.dub/packages/dcompute-master/dcompute/
Executable configuration "unittest" of package dcompute defines no main source file, this may cause certain build modes to fail. Add an explicit "mainSourceFile" to the package description to fix this.
Running custom 'unittest' configuration.
Performing "unittest" build using ldc2 for x86_64.
derelict-util 3.0.0-beta.2: building configuration "library"...
derelict-cl 3.2.0: building configuration "library"...
derelict-cuda 3.1.1: building configuration "library"...
taggedalgebraic 0.10.13: target for configuration "library" is up to date.
dcompute ~master: building configuration "unittest"...
To force a rebuild of up-to-date targets, run again with --force.
Running ../../../.dub/packages/dcompute-master/dcompute/dcompute 
object.Exception@../../../.dub/packages/dcompute-master/dcompute/source/dcompute/tests/main.d(106): Enforcement failed
----------------
??:? [0x55b341cfea80]
??:? [0x55b341d08d3a]
??:? [0x55b341cf026d]
exception.d:516 [0x55b341cba4a0]
exception.d:436 [0x55b341ca9465]
main.d:106 [0x55b341ca8a79]
??:? [0x55b341cefeef]
??:? [0x55b341cefde7]
__entrypoint.d:8 [0x55b341caa5d4]
??:? __libc_start_main [0x7f78136f42e0]
??:? [0x55b341ca8219]
Program exited with code 1

mneilly avatar Mar 25 '19 01:03 mneilly

You appear to be using OpenCL, which means that you need to figure out which device (if any) supports OpenCL 2.1 (for me that is the Intel experimental CPU) and adjust https://github.com/libmir/dcompute/blob/master/source/dcompute/tests/main.d#L24 to match whatever index that device is. I insulated the Nvidia 1.2 before the intel ones so that is index zero, then the intel 1.2 one is index one and the experimental 2.1 device is index 2.

thewilsonator avatar Mar 25 '19 01:03 thewilsonator

Thanks for the responses (and the creation of dcompute!). :)

I'm not intending to use CL. I see version = DComputeTestCUDA; at the top of ~/.dub/packages/dcompute-master/dcompute/source/dcompute/tests/ and I see that .dub/obj/kernels_cuda210_64.ptx was created...

If I comment out the enforce I see that res[] is all zero.

mneilly avatar Mar 25 '19 01:03 mneilly

Hmm, I'll have to look into that then.

thewilsonator avatar Mar 25 '19 01:03 thewilsonator

This may have been fixed by https://github.com/ldc-developers/ldc/pull/3251

thewilsonator avatar Dec 11 '19 06:12 thewilsonator