iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.85k stars 614 forks source link

Issue with Only Vulkan-Related Test Codes Failing on Android Device #15947

Open hiroto01230 opened 11 months ago

hiroto01230 commented 11 months ago

I've progressed through building IREE and running tests on Android, but I've encountered an issue where only Vulkan-related test codes are consistently failing. I've checked the Vulkan information on Android and didn't find any apparent issues, leaving me unsure of the cause.

Environment Details:

Android Version: 13 Vulkan apiVersion: 1.1.128 Build Steps:

Retrieved the code through Git using the x64_x86 Cross Tools Command Prompt for VS 2022. Executed vcvarsall.bat x64. Set the Android NDK path. Cloning and Submodule Update:

Git clone and git submodule update --init. Building for Host:

cmake -GNinja -B ../iree-build/ \ -DCMAKE_INSTALL_PREFIX=../iree-build/install \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ . cmake --build ../iree-build/ --target install

Building for Android: cmake -GNinja -B ../iree-build-android/ \ -DCMAKE_TOOLCHAIN_FILE="%ANDROID_NDK%/build/cmake/android.toolchain.cmake" \ -DIREE_HOST_BIN_DIR="%CD%/../iree-build/install/bin" \ -DANDROID_ABI="arm64-v8a" \ -DANDROID_PLATFORM="android-31" \ -DIREE_BUILD_COMPILER=OFF . cmake --build ../iree-build-android/

Testing:

Built test dependencies with cmake --build ../iree-build-android/ --target iree-test-deps. Ensured the Android device was visible with adb devices. Ran tests using ctest --test-dir ../iree-build-android/ --output-on-failure. Result: The detailed results are lengthy, but in summary, all tests related to Vulkan failed, whereas others passed successfully. This discrepancy is puzzling, especially given that the Vulkan setup on the Android device seems correct according to specifications.

I'm seeking insights into why this might be happening, whether it's a known issue with specific Android versions or Vulkan API levels, or if there are additional configurations or steps I should consider to resolve these test failures.

` Total Test time (real) = 457.62 sec

The following tests FAILED: 5 - iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device (Failed) 6 - iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_i4_to_f32.mlir_on_android_device (Failed) 8 - iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir_on_android_device (Failed) 21 - iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_scatter.mlir_on_android_device (Failed) 22 - iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_sort.mlir_on_android_device (Failed) 23 - iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_winograd_input.mlir_on_android_device (Failed) 24 - iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_winograd_output.mlir_on_android_device (Failed) 61 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_abs.mlir_on_android_device (Failed) 62 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_add.mlir_on_android_device (Failed) 63 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_dot.mlir_on_android_device (Failed) 64 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_reduce_min.mlir_on_android_device (Failed) 65 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_torch_index_select_high_rank.mlir_on_android_device (Failed) 66 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_torch_index_select_negative.mlir_on_android_device (Failed) 67 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_torch_index_select_scalar.mlir_on_android_device (Failed) 68 - iree/tests/e2e/regression/check_regression_vulkan-spirv_dynamic_torch_index_select_vector.mlir_on_android_device (Failed) 69 - iree/tests/e2e/regression/check_regression_vulkan-spirv_i1_inlined_constant.mlir_on_android_device (Failed) 70 - iree/tests/e2e/regression/check_regression_vulkan-spirv_linalg_ops.mlir_on_android_device (Failed) 71 - iree/tests/e2e/regression/check_regression_vulkan-spirv_reduction_broadcast_elementwise.mlir_on_android_device (Failed) 72 - iree/tests/e2e/regression/check_regression_vulkan-spirv_scalar_computation.mlir_on_android_device (Failed) 73 - iree/tests/e2e/regression/check_regression_vulkan-spirv_softmax.mlir_on_android_device (Failed) 74 - iree/tests/e2e/regression/check_regression_vulkan-spirv_strided_slice.mlir_on_android_device (Failed) 75 - iree/tests/e2e/regression/check_regression_vulkan-spirv_transpose.mlir_on_android_device (Failed) 196 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_abs.mlir_on_android_device (Failed) 197 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_add.mlir_on_android_device (Failed) 198 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_batch_norm_inference.mlir_on_android_device (Failed) 199 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_bitcast_convert.mlir_on_android_device (Failed) 200 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_broadcast.mlir_on_android_device (Failed) 201 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_broadcast_add.mlir_on_android_device (Failed) 202 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_broadcast_in_dim.mlir_on_android_device (Failed) 203 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_clamp.mlir_on_android_device (Failed) 204 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_compare.mlir_on_android_device (Failed) 205 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_complex.mlir_on_android_device (Failed) 206 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_concatenate.mlir_on_android_device (Failed) 207 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_constant.mlir_on_android_device (Failed) 208 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_convert.mlir_on_android_device (Failed) 209 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_convolution.mlir_on_android_device (Failed) 210 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_cosine.mlir_on_android_device (Failed) 211 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_divide.mlir_on_android_device (Failed) 212 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_dot.mlir_on_android_device (Failed) 213 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_dot_bf16.mlir_on_android_device (Failed) 214 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_dot_general.mlir_on_android_device (Failed) 215 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_dynamic_slice.mlir_on_android_device (Failed) 216 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_dynamic_update_slice.mlir_on_android_device (Failed) 217 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_exponential.mlir_on_android_device (Failed) 218 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_exponential_minus_one.mlir_on_android_device (Failed) 219 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_finite.mlir_on_android_device (Failed) 220 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_floor.mlir_on_android_device (Failed) 221 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_gather.mlir_on_android_device (Failed) 222 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_iota.mlir_on_android_device (Failed) 223 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_log.mlir_on_android_device (Failed) 224 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_log_plus_one.mlir_on_android_device (Failed) 225 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_maximum.mlir_on_android_device (Failed) 226 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_minimum.mlir_on_android_device (Failed) 227 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_multiply.mlir_on_android_device (Failed) 228 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_negate.mlir_on_android_device (Failed) 229 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_pad.mlir_on_android_device (Failed) 230 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_philox.mlir_on_android_device (Failed) 231 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_pow.mlir_on_android_device (Failed) 232 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_reduce.mlir_on_android_device (Failed) 233 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_reduce_window.mlir_on_android_device (Failed) 234 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_remainder.mlir_on_android_device (Failed) 235 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_reshape.mlir_on_android_device (Failed) 236 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_rng_normal.mlir_on_android_device (Failed) 237 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_rng_uniform.mlir_on_android_device (Failed) 238 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_round.mlir_on_android_device (Failed) 239 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_rsqrt.mlir_on_android_device (Failed) 240 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_scatter.mlir_on_android_device (Failed) 241 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_scatter_dynamic.mlir_on_android_device (Failed) 242 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_select.mlir_on_android_device (Failed) 243 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_sine.mlir_on_android_device (Failed) 244 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_slice.mlir_on_android_device (Failed) 245 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_sort.mlir_on_android_device (Failed) 246 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_sqrt.mlir_on_android_device (Failed) 247 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_subtract.mlir_on_android_device (Failed) 248 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_tanh.mlir_on_android_device (Failed) 249 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_three_fry.mlir_on_android_device (Failed) 250 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_torch_index_select.mlir_on_android_device (Failed) 251 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_transpose.mlir_on_android_device (Failed) 252 - iree/tests/e2e/stablehlo_ops/check_vulkan-spirv_vulkan_while.mlir_on_android_device (Failed) 266 - iree/tests/e2e/tensor_ops/check_vulkan-spirv_vulkan_extract_slice.mlir_on_android_device (Failed) 267 - iree/tests/e2e/tensor_ops/check_vulkan-spirv_vulkan_tensor_insert_slice.mlir_on_android_device (Failed) 390 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_abs.mlir_on_android_device (Failed) 391 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_add.mlir_on_android_device (Failed) 392 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_arithmetic_right_shift.mlir_on_android_device (Failed) 393 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_bitwise_and.mlir_on_android_device (Failed) 394 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_bitwise_or.mlir_on_android_device (Failed) 395 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_bitwise_xor.mlir_on_android_device (Failed) 396 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_ceil.mlir_on_android_device (Failed) 397 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_clamp.mlir_on_android_device (Failed) 398 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_clz.mlir_on_android_device (Failed) 399 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_const.mlir_on_android_device (Failed) 400 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_equal.mlir_on_android_device (Failed) 401 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_exp.mlir_on_android_device (Failed) 402 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_floor.mlir_on_android_device (Failed) 403 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_fully_connected.mlir_on_android_device (Failed) 404 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_gather.mlir_on_android_device (Failed) 405 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_greater.mlir_on_android_device (Failed) 406 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_greater_equal.mlir_on_android_device (Failed) 407 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_if.mlir_on_android_device (Failed) 408 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_log.mlir_on_android_device (Failed) 409 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_logical_left_shift.mlir_on_android_device (Failed) 410 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_logical_right_shift.mlir_on_android_device (Failed) 411 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_matmul.mlir_on_android_device (Failed) 412 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_max_pool.mlir_on_android_device (Failed) 413 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_maximum.mlir_on_android_device (Failed) 414 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_minimum.mlir_on_android_device (Failed) 415 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_mul.mlir_on_android_device (Failed) 416 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_mul_shift.mlir_on_android_device (Failed) 417 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_negate.mlir_on_android_device (Failed) 418 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_pad.mlir_on_android_device (Failed) 419 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_reciprocal.mlir_on_android_device (Failed) 420 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_reduce.mlir_on_android_device (Failed) 421 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_reshape.mlir_on_android_device (Failed) 422 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_rsqrt.mlir_on_android_device (Failed) 423 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_select.mlir_on_android_device (Failed) 424 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_sigmoid.mlir_on_android_device (Failed) 425 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_sub.mlir_on_android_device (Failed) 426 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_table.mlir_on_android_device (Failed) 427 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_tanh.mlir_on_android_device (Failed) 428 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_transpose.mlir_on_android_device (Failed) 429 - iree/tests/e2e/tosa_ops/check_vulkan-spirv_vulkan_while.mlir_on_android_device (Failed) 430 - iree/tests/e2e/vulkan_specific/check_vulkan-spirv_vulkan_f16_add_f16.mlir_on_android_device (Failed) 431 - iree/tests/e2e/vulkan_specific/check_vulkan-spirv_vulkan_f16_dot_f16.mlir_on_android_device (Failed) 432 - iree/tests/e2e/vulkan_specific/check_vulkan-spirv_vulkan_conv_conv.mlir_on_android_device (Failed) 433 - iree/tests/e2e/vulkan_specific/check_vulkan-spirv_vulkan_i64_emulation_add_i64.mlir_on_android_device (Failed) 434 - iree/tests/e2e/vulkan_specific/check_vulkan-spirv_vulkan_i64_emulation_mul_i64.mlir_on_android_device (Failed) 435 - iree/tools/test/iree_run_module_correctness_test_on_android_device (Failed) 519 - iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test_on_android_device (Failed) 520 - iree/hal/drivers/vulkan/cts/vulkan_command_buffer_dispatch_test_on_android_device (Failed) 521 - iree/hal/drivers/vulkan/cts/vulkan_command_buffer_push_constants_test_on_android_device (Failed) 524 - iree/hal/drivers/vulkan/cts/vulkan_event_test_on_android_device (Failed) 526 - iree/hal/drivers/vulkan/cts/vulkan_file_test_on_android_device (Failed) 528 - iree/hal/drivers/vulkan/cts/vulkan_semaphore_test_on_android_device (Failed) 545 - iree/modules/check/test/check_vulkan-spirv_vulkan_success.mlir_on_android_device (Failed) 572 - iree/samples/simple_embedding/simple_embedding_vulkan_test_on_android_device (Failed) Errors while running CTest `

ScottTodd commented 11 months ago

Thanks for the detailed report.

Were you able to see output logs for any of the failing tests, with specific errors? I see you set --output-on-failure 🤔

These would be a good starting point as they just exercise the Vulkan code, while the other tests use the full runtime and compiled code:

519 - iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test_on_android_device (Failed)
520 - iree/hal/drivers/vulkan/cts/vulkan_command_buffer_dispatch_test_on_android_device (Failed)
521 - iree/hal/drivers/vulkan/cts/vulkan_command_buffer_push_constants_test_on_android_device (Failed)
524 - iree/hal/drivers/vulkan/cts/vulkan_event_test_on_android_device (Failed)
526 - iree/hal/drivers/vulkan/cts/vulkan_file_test_on_android_device (Failed)
528 - iree/hal/drivers/vulkan/cts/vulkan_semaphore_test_on_android_device (Failed)
ScottTodd commented 11 months ago

For reference, here is a recent CI run on a Pixel 6 that includes Vulkan tests: https://github.com/openxla/iree/actions/runs/7219849588/job/19672528897 (Mostly to show that the tests can pass)

hiroto01230 commented 11 months ago

I have only been setting up complete local environments and running code locally without using GitHub Actions, so I'm currently learning about Actions to execute the given GitHub Action... Honestly, the increasing tasks are draining my motivation. I had just succeeded in building the environment on Windows following IREE's site, so this is quite challenging for me...

ScottTodd commented 11 months ago

I wouldn't worry about what the action is doing or trying to reproduce that. I'd just use it as a reference for what logs can look like when successful.

I'd expect your local environment has error logs for each failing test if you scroll up a bit, or maybe they are visible in logcat somewhere.

hiroto01230 commented 11 months ago

Understood, I am in the process of deleting all projects and rebuilding the environment for running Actions on my forked project. I will recreate everything up to the point where the error occurs again.

hiroto01230 commented 11 months ago

Also, just as an additional note, I was building on a PC with Japanese language settings and encountered a Unicode error with CMake and clang while trying to build IREE in a non-English environment. It might be helpful to include this in the documentation if you are considering users from non-English speaking regions.

ScottTodd commented 11 months ago

Also, just as an additional note, I was building on a PC with Japanese language settings and encountered a Unicode error with CMake and clang while trying to build IREE in a non-English environment. It might be helpful to include this in the documentation if you are considering users from non-English speaking regions.

Ooooo that's one I haven't heard before :D . Can you share the error? We should be able to fix that.

hiroto01230 commented 11 months ago

The error C4819 occurred in the file iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h. Despite confirming that the file was saved in UTF-8, the error persisted even after reopening it in a memo app and saving it again in UTF-8. The solution to this issue was to change the PC's regional language settings to English. This change in the language setting resolved the C4819 error. This suggests that certain language settings might affect how tools like CMake or clang handle character encoding in source files. Given that similar errors might occur in other parts of the code due to language settings, it's advisable to set the language configuration of your PC to English permanently.

D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\lib\Lex\Lexer.cpp(1574): note: while trying to match the argument list '(const llvm::sys::UnicodeCharRange [])' D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\lib\Lex\Lexer.cpp(1573): note: while trying to match the argument list '(const llvm::sys::UnicodeCharRange [])' [2651/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseInit.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2652/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseHLSL.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2653/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseStmt.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2654/7240] Building CXX object llvm-project\tools\clang\l...MakeFiles\obj.clangParse.dir\ParseCXXInlineMethods.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2655/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseAST.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2656/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseExprCXX.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2657/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseObjc.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2658/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParsePragma.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2659/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseStmtAsm.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2660/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseDeclCXX.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2661/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseExpr.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2662/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseOpenMP.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss [2663/7240] Building CXX object llvm-project\tools\clang\lib\Parse\CMakeFiles\obj.clangParse.dir\ParseDecl.cpp.obj D:\A_Jupyter\IREE\iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h(1): warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss

ScottTodd commented 11 months ago

The error C4819 occurred in the file iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h.

Ooof, that's in LLVM, one of our more complicated dependencies. I wonder if others upstream there have issues/workarounds/docs for it.

hiroto01230 commented 11 months ago

エラー C4819 は、ファイル iree\third_party\llvm-project\clang\include\clang/AST/ExprOpenMP.h で発生しました。

おっと、これはより複雑な依存関係の 1 つである LLVM にあります。他のアップストリームに問題/回避策/ドキュメントがあるかどうか疑問に思います。

The article I saw about avoiding the C4819 error related to LLVM was from a different project in Japanese. I believe this error likely depends on multiple projects.

hiroto01230 commented 11 months ago

I wouldn't worry about what the action is doing or trying to reproduce that. I'd just use it as a reference for what logs can look like when successful.

I'd expect your local environment has error logs for each failing test if you scroll up a bit, or maybe they are visible in logcat somewhere.

I've run the Android build of IREE again and here are the logs generated during some Vulkan-related checks

adb parameters: shell "cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_i4_to_f32.mlir/test_tmpdir /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_i4_to_f32.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_i4_to_f32.mlir/check_vulkan-spirv_vulkan_i4_to_f32.mlir_module.vmfb --device=vulkan" [==========] Running 2 tests from 1 test suite. [----------] Global test environment set-up. [----------] 2 tests from module [ RUN ] module.i4_to_f32_1d Segmentation fault Start 7: iree/tests/e2e/linalg/check_winograd_llvm-cpu_local-task_conv2d.mlir_on_android_device 7/631 Test #7: iree/tests/e2e/linalg/check_winograd_llvm-cpu_local-task_conv2d.mlir_on_android_device ....................................... Passed 0.77 sec Start 8: iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir_on_android_device 8/631 Test #8: iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir_on_android_device .......................................***Failed 0.91 sec Requested adb command: /data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/check_winograd_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan Using adb executable: C:\Users\owner\AppData\Local\Android\Sdk\platform-tools\adb.exe D:/A_Jupyter/IREE/iree-build-android/tools/iree-check-module: 1 file pushed, 0 skipped. 264.1 MB/s (12243304 bytes in 0.044s) check_winograd_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb: 1 file pushed, 0 skipped. 50.5 MB/s (9190 bytes in 0.000s) adb parameters: shell "cd /data/local/tmp && chmod +x /data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module" adb parameters: shell "cd /data/local/tmp && mkdir -p /data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir" adb parameters: shell "cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir /data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_winograd_vulkan-spirv_vulkan_conv2d.mlir/check_winograd_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan" [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from module [ RUN ] module.conv2d_nopadding Segmentation fault

ScottTodd commented 11 months ago

Well, it's interesting that those are segfaults instead of numerical errors, at least. The segfaults don't appear to have stack traces though.

(Also FYI, I'll personally be on vacation for a bit and I expect others will be less responsive over holidays as well. Wish I could help more...)

ScottTodd commented 11 months ago

A few more things to try...

hiroto01230 commented 11 months ago

The Vulkan version on the actual device, as well as its operation, have been confirmed as specified in the issue summary. Both the version and functionality have been verified. Additionally, as examples, I have listed below two cases: one of a successful test and another of a failed test.

check_winograd_llvm-cpu_local-task_conv2d D:\A_Jupyter\IREE\iree>ctest --test-dir ../iree-build-android/ -R check_winograd_llvm-cpu_local-task_conv2d.mlir_on_android_device --output-on-failure Internal ctest changing into directory: D:/A_Jupyter/IREE/iree-build-android Test project D:/A_Jupyter/IREE/iree-build-android Start 7: iree/tests/e2e/linalg/check_winograd_llvm-cpu_local-task_conv2d.mlir_on_android_device 1/1 Test #7: iree/tests/e2e/linalg/check_winograd_llvm-cpu_local-task_conv2d.mlir_on_android_device ... Passed 1.21 sec 100% tests passed, 0 tests failed out of 1 Label Time Summary: driver=local-task = 1.21 sec*proc (1 test) iree/tests/e2e/linalg = 1.21 sec*proc (1 test) Total Test time (real) = 1.64 sec

check_vulkan-spirv_vulkan_conv2d D:\A_Jupyter\IREE\iree>ctest --test-dir ../iree-build-android/ -R check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device --output-on-failure Internal ctest changing into directory: D:/A_Jupyter/IREE/iree-build-android Test project D:/A_Jupyter/IREE/iree-build-android Start 5: iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device 1/1 Test #5: iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device ...***Failed 1.11 sec Requested adb command: /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan Using adb executable: C:\Users\owner\AppData\Local\Android\Sdk\platform-tools\adb.exe D:/A_Jupyter/IREE/iree-build-android/tools/iree-check-module: 1 file pushed, 0 skipped. 268.5 MB/s (12243304 bytes in 0.043s) check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb: 1 file pushed, 0 skipped. 1.7 MB/s (9190 bytes in 0.005s) adb parameters: shell "cd /data/local/tmp && chmod +x /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module" adb parameters: shell "cd /data/local/tmp && mkdir -p /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir" adb parameters: shell "cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan" [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from module [ RUN ] module.conv2d_nopadding Segmentation fault 0% tests passed, 1 tests failed out of 1 Label Time Summary: driver=vulkan = 1.11 sec*proc (1 test) iree/tests/e2e/linalg = 1.11 sec*proc (1 test) Total Test time (real) = 1.16 sec The following tests FAILED: 5 - iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device (Failed) Errors while running CTest

hiroto01230 commented 11 months ago

D:\A_Jupyter\IREE\iree>ctest --test-dir ../iree-build-android/ -R check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device --output-on-failure -V Internal ctest changing into directory: D:/A_Jupyter/IREE/iree-build-android UpdateCTestConfiguration from :D:/A_Jupyter/IREE/iree-build-android/DartConfiguration.tcl Add coverage exclude regular expressions. UpdateCTestConfiguration from :D:/A_Jupyter/IREE/iree-build-android/DartConfiguration.tcl Test project D:/A_Jupyter/IREE/iree-build-android Run command: cmake -E rm -rf D:/A_Jupyter/IREE/iree-build-android/test_tmpdir Constructing a list of tests Done constructing a list of tests Updating test list for fixtures Added 0 tests to meet fixture requirements Checking test dependency graph... Checking test dependency graph end test 5 Start 5: iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device

5: Test command: D:\A_Jupyter\IREE\iree\build_tools\cmake\run_android_test.bat "/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module" "--module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb" "--device=vulkan" 5: Working Directory: D:/A_Jupyter/IREE/iree-build-android/tests/e2e/linalg 5: Environment variables: 5: TEST_ANDROID_ABS_DIR=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir 5: TEST_EXECUTABLE=D:/A_Jupyter/IREE/iree-build-android/tools/iree-check-module 5: TEST_DATA=check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb 5: TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir 5: Test timeout computed to be: 60 5: Requested adb command: /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan 5: Using adb executable: C:\Users\owner\AppData\Local\Android\Sdk\platform-tools\adb.exe 5: D:/A_Jupyter/IREE/iree-build-android/tools/iree-check-module: 1 file pushed, 0 skipped. 249.4 MB/s (12243304 bytes in 0.047s) 5: check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb: 1 file pushed, 0 skipped. 50.5 MB/s (9190 bytes in 0.000s) 5: adb parameters: shell "cd /data/local/tmp && chmod +x /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module" 5: adb parameters: shell "cd /data/local/tmp && mkdir -p /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir" 5: adb parameters: shell "cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan" 5: [==========] Running 1 test from 1 test suite. 5: [----------] Global test environment set-up. 5: [----------] 1 test from module 5: [ RUN ] module.conv2d_nopadding 5: Segmentation fault 1/1 Test #5: iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device ...***Failed 0.97 sec Requested adb command: /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan Using adb executable: C:\Users\owner\AppData\Local\Android\Sdk\platform-tools\adb.exe D:/A_Jupyter/IREE/iree-build-android/tools/iree-check-module: 1 file pushed, 0 skipped. 249.4 MB/s (12243304 bytes in 0.047s) check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb: 1 file pushed, 0 skipped. 50.5 MB/s (9190 bytes in 0.000s) adb parameters: shell "cd /data/local/tmp && chmod +x /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module" adb parameters: shell "cd /data/local/tmp && mkdir -p /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir" adb parameters: shell "cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/test_tmpdir /data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/iree-check-module --module=/data/local/tmp/iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir/check_vulkan-spirv_vulkan_conv2d.mlir_module.vmfb --device=vulkan" [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from module [ RUN ] module.conv2d_nopadding Segmentation fault

0% tests passed, 1 tests failed out of 1

Label Time Summary: driver=vulkan = 0.97 secproc (1 test) iree/tests/e2e/linalg = 0.97 secproc (1 test)

Total Test time (real) = 1.02 sec

The following tests FAILED: 5 - iree/tests/e2e/linalg/check_vulkan-spirv_vulkan_conv2d.mlir_on_android_device (Failed) Errors while running CTest

hiroto01230 commented 11 months ago

Screenshot_20231216-224155 Screenshot_20231216-224135

hiroto01230 commented 11 months ago

2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Build fingerprint: 'KDDI/SCV41_jp_kdi/SCV41:12/SP1A.210812.016/SCV41KDU1DWC1:user/release-keys' 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Revision: '18' 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A ABI: 'arm64' 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Processor: '5' 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Timestamp: 2023-12-16 23:24:34.097719192+0900 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Process uptime: 2s 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Cmdline: iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A pid: 18399, tid: 18399, name: vulkancommand >>> iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test <<< 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A uid: 2000 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A Cause: null pointer dereference 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A x0 b40000732920f750 x1 0000007fc1e06fc0 x2 ffffffffffffffff x3 7fffffffffffffff 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A x4 0000000000000000 x5 0000000000000002 x6 0000000000000001 x7 0000000000000001 2023-12-16 23:24:34.162 18402-18402 DEBUG pid-18402 A x8 0000000000000000 x9 0000007fc1e06fa0 x10 000000003b9df29c x11 b400007419208650 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A x12 0000007fc1e07048 x13 b4000073c9204010 x14 0000000000000000 x15 0000000000000000 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A x16 0000005654aab108 x17 000000758938fc00 x18 000000758ac34000 x19 0000007fc1e07030 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A x20 0000000000000000 x21 b40000735923aab0 x22 7fffffffffffffff x23 000000758a20c000 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A x24 0000007fc1e07200 x25 000000758a20c000 x26 2e8ba2e8ba2e8ba3 x27 b4000073f9212070 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A x28 2e8ba2e8ba2e8ba3 x29 0000007fc1e06ff0 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A lr 0000005654a24768 sp 0000007fc1e06fa0 pc 0000000000000000 pst 0000000060000000 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A backtrace: 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A NOTE: Function names and BuildId information is missing for some frames due NOTE: to unreadable libraries. For unwinds of apps, only shared libraries NOTE: found under the lib/ directory are readable. NOTE: On this device, run setenforce 0 to make the libraries readable. 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #00 pc 0000000000000000 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #01 pc 0000000000069764 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #02 pc 0000000000069b68 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #03 pc 0000000000062cb4 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #04 pc 0000000000065d2c /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #05 pc 000000000006241c /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #06 pc 000000000004cc98 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #07 pc 000000000004c9b4 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #08 pc 0000000000080a20 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #09 pc 00000000000808bc /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #10 pc 0000000000081c90 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #11 pc 0000000000082d1c /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #12 pc 0000000000092a20 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #13 pc 00000000000923e4 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #14 pc 00000000000921e0 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #15 pc 0000000000062ec0 /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 2023-12-16 23:24:34.163 18402-18402 DEBUG pid-18402 A #16 pc 000000000004a070 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+100) (BuildId: b5d187ac75fe4580e13ab2ec624bf7f1) 2023-12-16 23:24:34.168 1106-2081 NativeCrashListener system_server W Couldn't find ProcessRecord for pid 18399 2023-12-16 23:24:34.173 736-736 audit auditd E type=1701 audit(1702736674.162:587): auid=4294967295 uid=2000 gid=2000 ses=4294967295 subj=u:r:shell:s0 pid=18399 comm="vulkancommand" exe="/data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test" sig=11 res=1 2023-12-16 23:24:34.173 721-721 tombstoned tombstoned E Tombstone written to: tombstone_21

hiroto01230 commented 11 months ago

I've successfully run the test on an emulator without any issues, but upon examining the execution log, it appears that the test did not actually perform the operations. Instead, it skipped the processes related to Vulkan, leading to a successful result.

` 578: Test command: D:\A_Jupyter\IREE\iree\build_tools\cmake\run_android_test.bat "iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test" 578: Working Directory: D:/A_Jupyter/IREE/iree-build-android/runtime/src/iree/hal/drivers/vulkan/cts 578: Environment variables: 578: TEST_ANDROID_ABS_DIR=/data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test 578: TEST_EXECUTABLE=D:/A_Jupyter/IREE/iree-build-android/runtime/src/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test 578: TEST_TMPDIR=/data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/test_tmpdir 578: Test timeout computed to be: 60 578: Requested adb command: iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test 578: Using adb executable: C:\Users\owner\AppData\Local\Android\Sdk\platform-tools\adb.exe 578: D:/A_Jupyter/IREE/iree-build-android/runtime/src/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test: 1 file pushed, 0 skipped. 214.4 MB/s (8629392 bytes in 0.038s) 578: adb parameters: shell "cd /data/local/tmp && chmod +x /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test" 578: adb parameters: shell "cd /data/local/tmp && mkdir -p /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/test_tmpdir" 578: adb parameters: shell "cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/test_tmpdir iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/vulkan_command_buffer_test " 578: [==========] Running 22 tests from 1 test suite. 578: [----------] Global test environment set-up. 578: [----------] 22 tests from CTS/command_buffer_test 578: [ RUN ] CTS/command_buffer_test.Create/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.Create/vulkan (91 ms) 578: [ RUN ] CTS/command_buffer_test.BeginEnd/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.BeginEnd/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.SubmitEmpty/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.SubmitEmpty/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.CopyWholeBuffer/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.CopyWholeBuffer/vulkan (14 ms) 578: [ RUN ] CTS/command_buffer_test.CopySubBuffer/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.CopySubBuffer/vulkan (23 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern1_size1_offset0_length1/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size1_offset0_length1/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern1_size5_offset0_length5/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size5_offset0_length5/vulkan (19 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length1/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length1/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length3/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length3/vulkan (14 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length8/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length8/vulkan (11 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset2_length8/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset2_length8/vulkan (12 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern2_size2_offset0_length2/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size2_offset0_length2/vulkan (14 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset0_length8/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset0_length8/vulkan (16 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset0_length10/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset0_length10/vulkan (16 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset2_length8/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset2_length8/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern4_size4_offset0_length4/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size4_offset0_length4/vulkan (15 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern4_size4_offset16_length4/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size4_offset16_length4/vulkan (15 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern4_size16_offset0_length8/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size16_offset0_length8/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.FillBuffer_pattern4_size16_offset8_length8/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size16_offset8_length8/vulkan (13 ms) 578: [ RUN ] CTS/command_buffer_test.UpdateBufferWholeBuffer/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.UpdateBufferWholeBuffer/vulkan (11 ms) 578: [ RUN ] CTS/command_buffer_test.UpdateBufferWithOffsets/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.UpdateBufferWithOffsets/vulkan (11 ms) 578: [ RUN ] CTS/command_buffer_test.UpdateBufferSubspan/vulkan 578: iree/runtime/src/iree/../iree/hal/cts/cts_test_base.h:63: Skipped 578: Skipping test as default device for 'vulkan' driver is unavailable 578: 578: [ SKIPPED ] CTS/command_buffer_test.UpdateBufferSubspan/vulkan (20 ms) 578: [----------] 22 tests from CTS/command_buffer_test (411 ms total) 578: 578: [----------] Global test environment tear-down 578: [==========] 22 tests from 1 test suite ran. (413 ms total) 578: [ PASSED ] 0 tests. 578: [ SKIPPED ] 22 tests, listed below: 578: [ SKIPPED ] CTS/command_buffer_test.Create/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.BeginEnd/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.SubmitEmpty/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.CopyWholeBuffer/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.CopySubBuffer/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size1_offset0_length1/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size5_offset0_length5/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length1/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length3/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset0_length8/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern1_size16_offset2_length8/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size2_offset0_length2/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset0_length8/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset0_length10/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern2_size16_offset2_length8/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size4_offset0_length4/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size4_offset16_length4/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size16_offset0_length8/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.FillBuffer_pattern4_size16_offset8_length8/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.UpdateBufferWholeBuffer/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.UpdateBufferWithOffsets/vulkan 578: [ SKIPPED ] CTS/command_buffer_test.UpdateBufferSubspan/vulkan 578: adb parameters: shell "cd /data/local/tmp && rm -rf /data/local/tmp/iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test/test_tmpdir" 1/1 Test #578: iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test_on_android_device ... Passed 1.69 sec

The following tests passed: iree/hal/drivers/vulkan/cts/vulkan_command_buffer_test_on_android_device

100% tests passed, 0 tests failed out of 1

Label Time Summary: driver=vulkan = 1.69 secproc (1 test) iree/hal/drivers/vulkan/cts = 1.69 secproc (1 test)

Total Test time (real) = 1.78 sec`

ScottTodd commented 11 months ago

Okay, this is highlighting some gaps in our logging and error handling. The CTS tests should be giving more information.

We could log the status values here, ideally with full stack traces: https://github.com/openxla/iree/blob/f97aa4dec694c6c484d8eb35fc8dc9ba14459544/runtime/src/iree/hal/cts/cts_test_base.h#L45-L66

I'd like to know why creation is failing "gracefully" in here: https://github.com/openxla/iree/blob/main/runtime/src/iree/hal/drivers/vulkan/vulkan_driver.cc.

I don't have an environment set up to test this on Android right now, but these flags on iree-run-module (e.g. iree-run-module --dump_devices) might give more info: https://github.com/openxla/iree/blob/f97aa4dec694c6c484d8eb35fc8dc9ba14459544/runtime/src/iree/tooling/device_util.c#L169-L175

I suspect this Vulkan device is missing some of the features that IREE requires (e.g. timeline semaphores - https://github.com/openxla/iree/issues/4494 has some background there, and https://github.com/KhronosGroup/Vulkan-ExtensionLayer supposedly can polyfill support for it).

As for the tests with check_ in their names, I think those are just assuming that device creation will succeed and crashing if it fails. Those should also handle/log the errors. Might just be a matter of changing which macro is used here: https://github.com/openxla/iree/blob/f97aa4dec694c6c484d8eb35fc8dc9ba14459544/runtime/src/iree/modules/check/check_test.cc#L68-L72