Skip to content

Keep the block-0 index in range in the scan and findall kernels - #214

Open
SimonDanisch wants to merge 2 commits into
JuliaGPU:mainfrom
SimonDanisch:sd/llvmpipe-index-0
Open

SimonDanisch wants to merge 2 commits into
JuliaGPU:mainfrom
SimonDanisch:sd/llvmpipe-index-0

Conversation

@SimonDanisch

Copy link
Copy Markdown
Member

scan_tile_kernel! and the findall kernel read the previous block's result as
iblock == 0 ? start : tile_prefixes[iblock] (and block_counts[iblock]). For block 0 that
branch is not taken, but Mesa's llvmpipe (lavapipe) still runs the load because its address
is uniform over the work-group. Index 0 is one element before the array, so it segfaults when
that page is unmapped (about 1 in 4 runs of accumulate).

This clamps the index to max(iblock, one(iblock)). Block 0 never uses the value; every other
block reads the same element as before.

Tested: GPUArrays testsuite groups backed by AK (accumulate, findall, sorting, mapreduce) and
Raycore.jl's tests, 0 failures on llvmpipe and on a 7900 XTX (RADV).

@SimonDanisch

Copy link
Copy Markdown
Member Author

Any blockers to get this merged and tagged?

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant