Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SIGSEGV when compiled with -march=znver4 #19

Closed
wants to merge 1 commit into from

Conversation

AngryLoki
Copy link

Due to unaligned allocations, library crashes in nontemporalMemcpy in _mm512_stream_si512 (which requires 64-aligned allocations, but used to copy default-aligned objects).

As it is seemingly difficult to change allocations for copied objects (common objects with ref-counts), the fix just replaces nontemporalMemcpy with normal memcpy, which is already optimized in most versions of C runtime.

Closes #18

in _mm512_stream_si512 (which requires 64-aligned allocations,
but used to copy default-aligned objects).

As it is seemingly difficult to change allocations for copied
objects (common objects with ref-counts), the fix just replaces
nontemporalMemcpy with normal memcpy, which is already optimized
in most versions of C runtime.

Closes ROCm#18
@iassiour
Copy link
Contributor

Thank you @AngryLoki for raising this. There is a PARAMETERS_MIN_ALIGNMENT in https://github.com/ROCm-Developer-Tools/clr/blob/develop/rocclr/utils/flags.hpp#L55 that is set to 16 in 5.7.0 and I suspect it causes the issue.
Could you please try to set that to 64 for avx512 and confirm if it solves the issue?

@AngryLoki
Copy link
Author

@iassiour , thanks, it worked, I've replaced patch in Gentoo to gentoo/gentoo@6648534#diff-29d328ef381c60ad2e9731756f2d3c0465678976b91ef2bb5d2b63f45e05b9e0 .

So as there is nothing to do for develop branch (because it contains 64 for all targets), I'll close this pull-request, but I'd like to see a permanent fix for #18 in the next release.

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.

hipamd: SIGSEGV when compiled with -march=znver4
2 participants