Forums - Possible Adreno Vulkan driver bug (compute dispatch)

3 posts / 0 new
Last post
Possible Adreno Vulkan driver bug (compute dispatch)
louis-michel.ve...
Join Date: 16 Dec 20
Posts: 1
Posted: Thu, 2020-12-17 13:46

Hello,

Adreno Vulkan driver crashes if you set a viewport or scissor rectangle, then bind a compute pipeline and issue a dispatch, like so:

vkBeginCommandBuffer(cmdBuf, ...)
vkCmdSetViewport(cmdBuf, ...) // or vkCmdSetScissor(cmdBuf,  ...)
vkCmdBindPipeline(cmdBuf, VK_PIPELINE_BIND_POINT_COMPUTE, ...)
// this call will cause a segmentation fault in the Vulkan driver
vkCmdDispatch(cmdBuf, ...)

I have read the relevant parts of the Vulkan spec and I couldn't find anything indicating that doing this might be illegal.

This occurred on a Samsung Galaxy S10+ running Android 10. Device details:

  • From Vulkan Hardware Capability Viewer:
    - apiVersion: 1.1.87
    - deviceID:   0x6040001
    - deviceName: Adreno (TM) 640
    - driverVersion: 512.415.0
    - vendorID: 0x5143
    - operatingsystem android 10.0 (arm64)
    - android.BuildID: QP1A.190711.020
    - android.BuildVersionIncremental: G975U1UES4ETK1
    - android.ProductManufacturer: samsung
    - android.ProductModel: SM-G975U1

From AdrenoVK log messages:
    - QUALCOMM build             : 128c575, I000594fe7d
    - Build Date                             : 02/02/20
    - Shader Compiler Version : EV031.27.05.03
    - Local Branch                        : 
    - Remote Branch                   : refs/tags/AU_LINUX_ANDROID_LA.UM.8.1.R1.10.00.00.529.103

 

I'm reporting this issue here but if anyone knows of a more appropriate channel to report issues such as these, please let me know.

Thanks

  • Up0
  • Down0
AndreyVK_D3D
Profile picture
Join Date: 10 Jun 13
Location: Moscow
Posts: 36
Posted: Tue, 2021-01-05 07:23

Hi,

1) I think you have no access to ViewPort data from compute stage at all(may be I'm wrong), so you needn't set viewport for Compute Stage, my be you will have UB in this case

2) do you have any validation error from Vulkan Validation Layers ?

3) have you checked on another devices ?

4) do you have  a minimal test case for reproduce this error?

5)

if anyone knows of a more appropriate channel to report issues such as these, please let me know.

You can ask on Discord Vulkan Channel, Khronos slack, Khronos Vulkan Forum

  • Up0
  • Down0
nocter31415
Join Date: 31 Jan 24
Posts: 1
Posted: Thu, 2024-02-01 21:53

Hi,

I also meet the same problem while having a renderpass which setViewPort() before dispatching compute jobs.
I will give you some information that you're asking about:

3) I meet this problem on many adreno devices, such as:
 GPU    Device Name    Firmware
Adreno 650    Black Shark 4    Android 12
Adreno 620    LG Wing    Android 10
Adreno 640    Galaxy Note 10    Android 9
Adreno 630    Galaxy S9    Android 10

4) I used Khronos Vulkan sample which was recommend by NDK Guides: Get started
to reproduce my rendering flow.

After adding a renderpass with setViewPort() before dispatching compute job
for Compute N-body simulation function (image is in this link)
My changes are in add_a_renderpass_before_vkCmdDispatch.diff

2) It was crashed on Adreno gpus  without any validation's log.
Log:

Quote:

I/VulkanSamples: [info] Before vkCmdDispatch
W/.vulkan_sample: 0xebadde09 skipped times: 0
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xf0 in tid 21294 (.vulkan_samples), pid 20961 (.vulkan_samples)

The callstack:
Quote:

art_sigsegv_fault 0x0000007b1c33b24c
art::faultmanager::HandleFault(int, siginfo *, void *) 0x0000007b1c33b768
art::signalchain::Handler(int, siginfo *, void *) 0x00000064c9e5fcb4
__kernel_rt_sigreturn 0x0000007ba38c363c
<unknown> 0x0000007afa5bb43c
<unknown> 0x0000007afa587d70
<unknown> 0x0000007af61905e0
vulkan::api::CmdDispatch(VkCommandBuffer_T *, unsigned int, unsigned int, unsigned int) 0x0000007ba272c9e8
ComputeNBody::build_compute_command_buffer() compute_nbody.cpp:230
ComputeNBody::prepare_compute() compute_nbody.cpp:700
ComputeNBody::prepare(const vkb::ApplicationOptions &) compute_nbody.cpp:874
vkb::platform::start_app() platform.cpp:367
vkb::platform::main_loop() platform.cpp:145
platform_main(const vkb::PlatformContext &) main.cpp:56
android_main(android_app *) main.cpp:36
android_app_entry android_native_app_glue.c:235
pthread_start(void *) 0x0000007b9d034cd4
start_thread 0x0000007b9cfc7254

I tested with other gpus excepting adreno, it works fine.
I hope you could reproduce this case with my information!
Please tell me if you find out any clue and what could we do for handling it, thanks!
 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.