Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM 16 CTS SPIRV failures #1232

Closed
franz opened this issue May 24, 2023 · 3 comments
Closed

LLVM 16 CTS SPIRV failures #1232

franz opened this issue May 24, 2023 · 3 comments
Milestone

Comments

@franz
Copy link
Contributor

franz commented May 24, 2023

92% tests passed, 11 tests failed out of 144

The following tests FAILED:
598 - conformance_spirv_allocations_image (Failed)
599 - conformance_spirv_api (Failed)
600 - conformance_spirv_api_ocl_30 (Failed)
605 - conformance_spirv_basic_image (Failed)
607 - conformance_spirv_basic_other_ocl_30 (Failed)
615 - conformance_spirv_buffers_var2 (Failed)
877 - conformance_spirv_profiling (Failed)
914 - conformance_spirv_SVM_1 (Failed)
1180 - conformance_spirv_images_micro_samplerless_reads_2D (Failed)
1182 - conformance_spirv_images_micro_samplerless_reads_1Darray (Failed)
1186 - conformance_spirv_basic_micro_other (Failed)
Errors while running CTest
Error: Process completed with exit code 8.

@franz franz added this to the 4.0 milestone May 24, 2023
franz added a commit to franz/pocl that referenced this issue May 24, 2023
franz added a commit to franz/pocl that referenced this issue May 24, 2023
@franz
Copy link
Contributor Author

franz commented May 24, 2023

Almost all failures are related to image types present in SPIR-V:

647: error: line 116: Result <id> from OpSampledImage instruction must not appear as operand for OpBitcast, since it is not specified as taking an OpTypeSampledImage. Found result <id> '30[%TempSampledImage]' as an operand of <id> '31[%31]'.
647:   %TempSampledImage = OpSampledImage %29 %src %sampler0

647: error: line 797: Expected Result Type to be a pointer or int or float vector or scalar type: Bitcast
647:   %140 = OpBitcast %137 %138
647: 

The ones not related to images:

conformance_spirv_basic_other_ocl_30 -> progvar_prog_scope_init

655: progvar_prog_scope_init...
655:   bool Saved kernel source to file: /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/writer.reader.7c8d1744.a7cce4c4.cl
655: Saved kernel build options to file: /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/writer.reader.7c8d1744.a7cce4c4.options
655: Executing command: /home/michal/0/build/b_pocl_16/cl_offline_compiler.sh --mode=spir-v --source=/home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/writer.reader.7c8d1744.a7cce4c4.cl --output=/home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/writer.reader.7c8d1744.a7cce4c4.spv64 --cl-device-info=/home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/clDeviceInfo-b243d248.txt -- -cl-std=CL3.0
655: CL_DEV_INFO: /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/clDeviceInfo-b243d248.txt
655: test_basic: /home/llvm_build/source/llvm-project/llvm/lib/IR/Instructions.cpp:3356: static llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
1/1 Test #655: conformance_spirv_basic_other_ocl_30 ...Subprocess aborted***Exception:  22.80 sec

conformance_spirv_SVM_1 -> svm_fine_grain_memory_consistency

962: svm_fine_grain_memory_consistency...
962: Saved kernel source to file: /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/build_hash_table.5dae34cf.b467a359.cl
962: Saved kernel build options to file: /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/build_hash_table.5dae34cf.b467a359.options
962: Executing command: /home/michal/0/build/b_pocl_16/cl_offline_compiler.sh --mode=spir-v --source=/home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/build_hash_table.5dae34cf.b467a359.cl --output=/home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/build_hash_table.5dae34cf.b467a359.spv64 --cl-device-info=/home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/clDeviceInfo-b243d248.txt --  -cl-std=CL3.0
962: CL_DEV_INFO: /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/clDeviceInfo-b243d248.txt
962: error: line 107: AtomicCompareExchange: expected Pointer to point to a value of type Result Type
962:   %49 = OpAtomicCompareExchange %ulong %48 %uint_0 %uint_16 %uint_0 %44 %exp
962: 
962: Failed to validate SPIR-V file /home/michal/0/build/b_pocl_16/CTS_FULL_CACHE/build_hash_table.5dae34cf.b467a359.spv64: system() returned 0x100
962: Create program failed: -15, line: 806
962: ERROR: failed to create program! (CL_COMPILE_PROGRAM_FAILURE from /home/michal/0/build/examples/conformance/src/conformance/test_conformance/SVM/main.cpp:257)
962: svm_fine_grain_memory_consistency FAILED

@franz
Copy link
Contributor Author

franz commented May 26, 2023

I've added a partial fix (missing AS cast) for the conformance_spirv_basic_other_ocl_30 -> progvar_prog_scope_init issue, this issue is now resolved with LLVM 15, but with LLVM 16 it fails in SPIR-V validator.

Created LLVM-SPIRV-Translator issues: progvar_prog_scope_init, svm_fine_grain_memory_consistency, invalid OpBitcast with Images.

@franz
Copy link
Contributor Author

franz commented May 26, 2023

I've added documentation to PoCL, but since these are issues in upstream Clang and/or translator, AFAICT they need to be fixed upstream.

@franz franz closed this as completed May 26, 2023
franz added a commit to franz/pocl that referenced this issue May 29, 2023
franz added a commit to franz/pocl that referenced this issue Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant