llvm icon indicating copy to clipboard operation
llvm copied to clipboard

`assert` doesn't work on OpenCL GPU after driver uplift

Open AlexeySachkov opened this issue 2 years ago • 1 comments

Describe the bug

Testing in #11302 shows that assert does not produce any messages and doesn't stop program execution with NEO 23.30.26918.9 when using opencl backend.

Affected tests:

  • sycl/test-e2e/Assert/assert_in_kernels.cpp
  • sycl/test-e2e/Assert/assert_in_multiple_tus.cpp
  • sycl/test-e2e/Assert/assert_in_multiple_tus_one_ndebug.cpp
  • sycl/test-e2e/Assert/assert_in_one_kernel.cpp
  • sycl/test-e2e/Assert/assert_in_simultaneous_kernels.cpp
  • sycl/test-e2e/Assert/assert_in_simultaneously_multiple_tus.cpp
  • sycl/test-e2e/Assert/assert_in_simultaneously_multiple_tus_one_ndebug.cpp

To Reproduce

Install NEO 23.30.26918.9, launch the test using any existing mechanism for that (check-sycl-e2e target or just repeating commands manually)

It is expected that when a test binary is launched, it prints a message about assert failure and exist with a non-zero exit code before printing some final message like "The test ended.", but it shouldn't happen.

Environment (please complete the following information):

  • OS: Linux
  • Target device and vendor: Intel GPU
  • DPC++ version: any recent intel/llvm will do
  • Dependencies version: NEO 23.30.26918.9

AlexeySachkov avatar Sep 29 '23 15:09 AlexeySachkov

We discussed this with @PawelJurek and the behavior is expected from the GPU driver point view. GPU driver recently got native support for assert, i.e. cl_intel_devicelib_cassert was implemented. That includes automatic removal of any fallback assert implementation SYCL compiler may be inserting. However, as I understood it mechanism for communicating the assertion back to host was only implemented for Level Zero path and not for OpenCL path.

AlexeySachkov avatar Oct 04 '23 10:10 AlexeySachkov