Status Update
Comments
sy...@google.com <sy...@google.com> #2
Here's a renderdoc capture of the issue taken on a Pixel2XL with a very recent Android build.
ap...@google.com <ap...@google.com> #3
Branch: master
commit a3b16c6b50a64df299cfde89dcbe3068777a4adb
Author: Shahbaz Youssefi <syoussefi@chromium.org>
Date: Fri Aug 28 16:14:30 2020
Vulkan: Workaround vkCmdClearAttachment bug on Pixel
Adds a workaround to use draw calls to clear color instead of
vkCmdClearAttachment when the clear happens in the middle of render
pass. On Pixel phones, vkCmdClearAttachment races with the previous
draw calls in the render pass.
Bug:
Change-Id: I8c96b87793da191757635658ad4ee2c3a7875aca
Reviewed-on:
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
M include/platform/FeaturesVk.h
M src/libANGLE/renderer/vulkan/FramebufferVk.cpp
M src/libANGLE/renderer/vulkan/RendererVk.cpp
sy...@google.com <sy...@google.com> #4
The issue is not limited to color clears. The following test added in
ClearTestES3.ClearMaxAttachmentsAfterDraw/ES3_Vulkan
ti...@google.com <ti...@google.com> #5
The following CL is enabling using vkCmdClearAttachements
for scissored clears, rather than drawing:
3388635: Vulkan: Use vkCmdClearAttachments for scissored clears |
With that CL, the following tests expose another issue with Pixel 4 Qualcomm drivers:
FramebufferMultiviewLayeredClearTest.ScissoredClear/ES3_Vulkan__vertex_shader_multiview2
FramebufferMultiviewLayeredClearTest.ScissoredClear/ES3_Vulkan__vertex_shader_multiview
QC is not interpretting the VkClearRect.layerCount
value incorrectly and is clearing too many layers. Looking at FramebufferMultiviewLayeredClearTest.ScissoredClear/ES3_Vulkan__vertex_shader_multiview
specifically, the vkCmdClearAttachements
command is being issued with VkClearRect.layerCount = 2
, but is actually clearing layers 1, 2, and 3. Layer 0 is correctly being skipped.
To work around this, preferDrawClearOverVkCmdClearAttachments
will be enabled for QC in general, rather than just specific Pixel devices.
ph...@qualcomm.corp-partner.google.com <ph...@qualcomm.corp-partner.google.com> #6
sy...@google.com <sy...@google.com> #7
Done, though I got a warning that digishp@ might not be able to interact with the bug.
It's a public bug though, so :shrug:
di...@qualcomm.corp-partner.google.com <di...@qualcomm.corp-partner.google.com> #8
is there any updated steps to reproduce this problem ? (I believe angle is having some workaround which we might need to disable)
sy...@google.com <sy...@google.com> #9
Yes. I hope you are familiar with building and running tests with ANGLE?
Look for preferDrawClearOverVkCmdClearAttachments
. In RendererVk.cpp
, you would need to change the condition from isQualcommProprietary
to false
. Alternatively, you should be able to modify this behavior at run time by setting:
$ adb shell setprop debug.angle.feature_overrides_disabled preferDrawClearOverVkCmdClearAttachments
before running the test.
di...@qualcomm.corp-partner.google.com <di...@qualcomm.corp-partner.google.com> #10
di...@qualcomm.corp-partner.google.com <di...@qualcomm.corp-partner.google.com> #11
is there any known problem with 64 bit angle apk to run CTS ?
we checked 32 bit Angle APK we were able to run CTS test case successfully however, it was not using the VkCmdClearAttachments so couldn't confirm the issue mentioned here.
sy...@google.com <sy...@google.com> #12
is there any known problem with 64 bit angle apk to run CTS ?
Not that I know of, but I'll check.
we checked 32 bit Angle APK we were able to run CTS test case successfully however, it was not using the VkCmdClearAttachments so couldn't confirm the issue mentioned here.
Did you do $ adb shell setprop debug.angle.feature_overrides_disabled preferDrawClearOverVkCmdClearAttachments
first?
sy...@google.com <sy...@google.com> #13
@yuxinhu, since you are running dEQP over ANGLE recently, do you think you could share some insight on what should be done for it to work?
yu...@google.com <yu...@google.com> #14
Yes Shabi, here are two ways I run dEQP over ANGLE on Pixel 4:
Option 1. Build Khronos CTS with ANGLE
Step 1. Build ANGLE
gn gen out/AndroidDebug
gn args out/AndroidDebug
Add these gn args in the editor and save the file
arget_os = "android"
target_cpu = "arm64"
android32_ndk_api_level = 29
android64_ndk_api_level = 29
angle_libs_suffix = "_angle"
is_component_build = false
symbol_level = 1
is_debug = false
dcheck_always_on = true
angle_enable_vulkan = true
angle_enable_trace = true
angle_expose_non_conformant_extensions_and_versions=true
Then run the command to build ANGLE:
autoninja -C out/AndroidDebug
Create a folder arm64-v8a
under out/AndroidDebug
and copy the angle libs to the folder:
mkdir arm64-v8a
cd arm64-v8a
cp ../lib*_angle.so .
Step 2. Build Khronos CTS package with ANGLE as the GLES driver:
Get the khronos CTS source code from
Sample command to build CTS for Android:
python3 scripts/android/build_apk.py --target=openglcts --sdk ~/Projects/VK-GL-CTS-Android-Deps/android-sdk --ndk ~/Projects/VK-GL-CTS-Android-Deps/android-ndk-r25b --abis arm64-v8a --angle-path ~/angle/out/AndroidDebug/
Replace the values passed to --sdk
and --ndk
with the actual path that stores the android-sdk and android-ndk
Step 3. Install the Khronos CTS package:
python3 scripts/android/install_apk.py --target=openglcts
Step 4. Launch the test with the command:
e.g. to run the test dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.11
:
adb shell 'am start -n org.khronos.gl_cts/android.app.NativeActivity -e cmdLine "cts --deqp-case=dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.11 --deqp-log-filename=/sdcard/deqp-debug-log.qpa"'
Option 2. Run dEQP tests with ANGLE dEQP test runner
Step 1. Build ANGLE.
This will be the same as step 1. in Option 1. above.
Step 2. Launch the test with the command:
e.g. to run the test dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.11
:
out/AndroidDebug/angle_deqp_gles3_tests --gtest_filter="dEQP?GLES3.functional.fragment_ops.random.1" --verbose --local-output
If you are testing with Pixel 4, please remove this line in the src/tests/deqp_support/deqp_gles3_test_expectations.txt
:
5990 PIXEL4ORXL VULKAN : dEQP-GLES3.functional.fragment_ops.random.* = SKIP
di...@qualcomm.corp-partner.google.com <di...@qualcomm.corp-partner.google.com> #15
in 32 bit.
>> Did you do $ adb shell setprop debug.angle.feature_overrides_disabled preferDrawClearOverVkCmdClearAttachments first?
The way we were doing this still it was not using VkCmdClearAttachments from api dump and test was passing.
in 64 bit
it was failing many test cases due to image comparison mismatch with or with or without this option.
the procedure we used was.
adb install the 64-bit angle apk
adb shell settings put global angle_debug_package org.chromium.angle
adb shell settings put global angle_gl_driver_selection_values angle
adb shell settings put global angle_gl_driver_selection_pkgs com.drawelements.deqp
adb shell "am start -n com.drawelements.deqp/android.app.NativeActivity -e cmdLine 'deqp --deqp-case=dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.* --deqp-log-filename=/sdcard/TestResults.qpa'"
yu...@google.com <yu...@google.com> #16
Thank you digishp@.
We managed to reproduce the bug on Pixel 4 device:
-
Build ANGLE. Command and gn args to use is the same as the step 1. option 1. in
. This should build a 64-bit angle apk, because the gn args used iscomment #14 target_cpu = "arm64"
. -
In ANGLE root directory: run the test with this command:
out/AndroidDebug/angle_deqp_gles3_tests --gtest_filter="dEQP?GLES3.functional.fragment_ops.interaction.basic_shader.60" --verbose --local-output --skip-clear-data
-
Cherry pick the change in
https://chromium-review.googlesource.com/c/angle/angle/+/4706144 . Re-build ANGLE. -
Run the same test in step 2:
out/AndroidDebug/angle_deqp_gles3_tests --gtest_filter="dEQP?GLES3.functional.fragment_ops.interaction.basic_shader.60" --verbose --local-output --skip-clear-data
We observe the test passed after step 2, but failed after step 4. Would you please let us know if you observe the same on your test device?
yu...@google.com <yu...@google.com> #17
Alternative repro method on top of
We also attached the angle_deqp_gles3_tests-debug.apk
for you to try:
-
Install the apk:
adb install -r -d --force-queryable angle_deqp_gles3_tests-debug.apk
. -
Launch the test with below command:
adb shell "am start -n com.android.angle.test/com.android.angle.test.AngleUnitTestActivity -e org.chromium.native_test.NativeTest.StdoutFile /sdcard/chromium_tests_root/out.txt -e org.chromium.native_test.NativeTest.CommandLineFlags '--gtest_filter=dEQP?GLES3.functional.fragment_ops.interaction.basic_shader.60'"
- Pull the qpa result file from the test device:
adb pull /data/data/com.android.angle.test/TestResults.qpa
The qpa result we got from Pixel 4 indicating the test failed. If you use this method, could you please let us know if you observe the same result on your test device?
di...@qualcomm.corp-partner.google.com <di...@qualcomm.corp-partner.google.com> #18
-----
Regarding
We are seeing following error when trying the given steps with provided apk.
I NativeTest: runTests: --gtest_filter=dEQP?GLES3.functional.fragment_ops.interaction.basic_shader.60
E chromium: Failed to open stdout file: /sdcard/chromium_tests_root/out.txt: Operation not permitted
- Do we need to push some files for the test to run?
- We tried creating /sdcard/chromium_tests_root and giving all permissions to the folder
- Given Native Test app has all permissions
#2
-----
Another thing we were trying is to compiler APK at our end.
we are ending up in some problems.
To build angle from scratch we are following the process mentioned here.
We encountered build errors almost at each step and some of which are below -
While initializing Repo Client, we were seeing python syntax related issues-
.repo/repo/main.py", line 126
except ManifestInvalidRevisionError, e:
^
SyntaxError: invalid syntax
The repo revision that cloned during initializing was way older (~ v1.75) and incompatible with python 2.7 or python 3.6.
Solution:
We had to explicitly specify rev version from the arg like below
repo init -u
We saw such python related issues at different steps too.
Currently, we are stuck at the below error
$ ninja -v -C out/Default third_party/angle:angle_apks
ninja: Entering directory `out/Default'
[1/72] touch obj/third_party/android_deps/com_google_errorprone_error_prone_check_api_java__header.stamp
[2/72] python3 ../../build/android/gyp/turbine.py --depfile=gen/build/android/bytecode/bytecode_processor_java__header.d --generated-dir=gen/build/android/bytecode/bytecode_processor_java/generated_java --jar-path=obj/build/android/bytecode/bytecode_processor_java.turbine.jar --java-srcjars=\[\] --target-name //build/android/bytecode:bytecode_processor_java__header --classpath=@FileArg\(gen/build/android/bytecode/bytecode_processor_java.build_config.json:javac:interface_classpath\) --processorpath=@FileArg\(gen/build/android/bytecode/bytecode_processor_java.build_config.json:javac:processor_classpath\) --processors=@FileArg\(gen/build/android/bytecode/bytecode_processor_java.build_config.json:javac:processor_classes\) --turbine-jar-path ../../third_party/turbine/turbine.jar --generated-jar-path gen/build/android/bytecode/bytecode_processor_java.generated.srcjar --chromium-code=1 --warnings-as-errors @gen/build/android/bytecode/bytecode_processor_java.sources
FAILED: obj/build/android/bytecode/bytecode_processor_java.turbine.jar gen/build/android/bytecode/bytecode_processor_java.generated.srcjar
python3 ../../build/android/gyp/turbine.py --depfile=gen/build/android/bytecode/bytecode_processor_java__header.d --generated-dir=gen/build/android/bytecode/bytecode_processor_java/generated_java --jar-path=obj/build/android/bytecode/bytecode_processor_java.turbine.jar --java-srcjars=\[\] --target-name //build/android/bytecode:bytecode_processor_java__header --classpath=@FileArg\(gen/build/android/bytecode/bytecode_processor_java.build_config.json:javac:interface_classpath\) --processorpath=@FileArg\(gen/build/android/bytecode/bytecode_processor_java.build_config.json:javac:processor_classpath\) --processors=@FileArg\(gen/build/android/bytecode/bytecode_processor_java.build_config.json:javac:processor_classes\) --turbine-jar-path ../../third_party/turbine/turbine.jar --generated-jar-path gen/build/android/bytecode/bytecode_processor_java.generated.srcjar --chromium-code=1 --warnings-as-errors @gen/build/android/bytecode/bytecode_processor_java.sources
Traceback (most recent call last):
File "../../build/android/gyp/turbine.py", line 14, in <module>
import compile_java
File "/local/mnt/workspace/ANGLE/chromium/src/build/android/gyp/compile_java.py", line 19, in <module>
import javac_output_processor
File "/local/mnt/workspace/ANGLE/chromium/src/build/android/gyp/javac_output_processor.py", line 15, in <module>
from util import dep_utils
File "/local/mnt/workspace/ANGLE/chromium/src/build/android/gyp/util/dep_utils.py", line 6
from __future__ import annotations
^
SyntaxError: future feature annotations is not defined
-Are these known problems ?
-Is there any specific python version that we should have for building angle apk?
-Are the steps mentioned at
yu...@google.com <yu...@google.com> #19
Hi digishp@,
Thank you for the update.
#1 Apologize for the missing information in the instruction. It turns out some additional files and permission settings are required when running the test directly from the apk. Please try below steps:
-
Enable adb root on the testing device:
adb root
. -
Install the test apk:
adb install -r -d -g --force-queryable ~/Downloads/angle_deqp_gles3_tests-debug.apk
-
Set storage permission of the test app:
adb shell appops set com.android.angle.test MANAGE_EXTERNAL_STORAGE allow || true
-
Download the attached zip file
chromium_tests_root.zip
and unzip the file. -
Push the unzipped file to the
/sdcard/
directory of your testing device:adb push chromium_tests_root /sdcard/
-
Launch test:
adb shell "am start -n com.android.angle.test/com.android.angle.test.AngleUnitTestActivity -e org.chromium.native_test.NativeTest.StdoutFile /sdcard/chromium_tests_root/out.txt -e org.chromium.native_test.NativeTest.CommandLineFlags '--gtest_filter=dEQP?GLES3.functional.fragment_ops.interaction.basic_shader.60'"
- Pull the test results from the testing device:
adb pull /data/data/com.android.angle.test/TestResults.qpa
#2 The doc you referenced to
-
Refer to
to sync ANGLE source code and setup build tools, specifically, follow the steps inDevSetup ,Version Control , andRequired First Setup .Getting the source -
Refer to
to download Android build dependencies and setup android build args.Setting up the ANGLE build for Android -
Build ANGLE for Android with command
autoninja -C out/Android
. -
Launch the test with command
out/Android/angle_deqp_gles3_tests --gtest_filter="dEQP?GLES3.functional.fragment_ops.interaction.basic_shader.60" --verbose --local-output --skip-clear-data
Please let us know if this works for you.
Description
at time of the second draw, some tiles show the value of the first draw, instead of the clear color. It's as if the first draw and the vkCmdClearAttachments call are racing.
Debugging with renderdoc, I see the masked-clear draw call work fine. I see the vkCmdClearAttachment also work fine. However, running up to the first draw call after that, I see parts of the color attachment have the masked-clear draw call output, as if it raced with vkCmdClearAttachment. See the following screenshots from renderdoc:
vkCmdClearAttachment
: 2.pngThe description of vkCmdClearAttachment says:
So no barrier should be necessary for draw->clearAttachments->draw, which leads me to believe this is a Qualcomm driver bug.
With the above change, the following tests fail on dEQP due to this. Note that the change affects these tests by changing the first draw call (which does a masked clear) to issue one large triangle covering the render area instead of two triangles.
dEQP.GLES3/functional_fragment_ops_interaction_basic_shader_11 dEQP.GLES3/functional_fragment_ops_interaction_basic_shader_40 dEQP.GLES3/functional_fragment_ops_random_1 dEQP.GLES3/functional_fragment_ops_random_12 dEQP.GLES3/functional_fragment_ops_random_17 dEQP.GLES3/functional_fragment_ops_random_18 dEQP.GLES3/functional_fragment_ops_random_2 dEQP.GLES3/functional_fragment_ops_random_32 dEQP.GLES3/functional_fragment_ops_random_40 dEQP.GLES3/functional_fragment_ops_random_41 dEQP.GLES3/functional_fragment_ops_random_52 dEQP.GLES3/functional_fragment_ops_random_81 dEQP.GLES3/functional_fragment_ops_random_93 dEQP.GLES3/functional_fragment_ops_random_96