Skip to content

[SYCL][CUDA] Alignment issue with zero-sized local arguments #5682

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

Closed
nmnobre opened this issue Feb 28, 2022 · 3 comments
Closed

[SYCL][CUDA] Alignment issue with zero-sized local arguments #5682

nmnobre opened this issue Feb 28, 2022 · 3 comments
Labels
bug Something isn't working cuda CUDA back-end runtime Runtime library related issue

Comments

@nmnobre
Copy link
Contributor

nmnobre commented Feb 28, 2022

Describe the bug

The alignment strategy for local arguments introduced with PR #5113 does not take into account zero-sized local arguments. Since, in such circumstances, the requested alignment is also zero (see sycl/plugins/cuda/pi_cuda.hpp):

const size_t alignment = std::min(max_alignment, size);,

the program receives signal SIGFPE, Arithmetic exception at runtime at the following modulus test:

localOffset % alignment != 0.

This problem is similar to that reported in issue #1467. I confess I understand little about local arguments or why the application I'm using uses zero-sized local arguments. Please do feel free to disregard this issue if this is just incorrect behaviour by the application.

Environment:

  • OS: CentOS Linux release 8.5.2111
  • Target device and vendor: NVIDIA Quadro GV100
  • DPC++ version: ebb1281 and newer
@nmnobre nmnobre added the bug Something isn't working label Feb 28, 2022
@bader bader added compiler Compiler related issue cuda CUDA back-end runtime Runtime library related issue and removed compiler Compiler related issue labels Feb 28, 2022
@bader bader linked a pull request Feb 28, 2022 that will close this issue
@JackAKirk
Copy link
Contributor

JackAKirk commented Apr 5, 2022

Hi @nmnobre

We hope that #5683 will fix your issue, but do you have your sample code that ran into the problem so that we can be certain that your particular use case is solved by the patch?

Thanks

@AerialMantis
Copy link
Contributor

Related pull request for adding a test for zero-sized local accessors - intel/llvm-test-suite#1001

@AerialMantis
Copy link
Contributor

This issue has been addressed more generically in the SYCL runtime by #6032, with this patch zero-sized local memory arguments are padded to 1 byte so this case is never encountered in the backends. @nmnobre I believe this issue to be resolved so I will close the ticket, however, if you feel an issue persists we can re-open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cuda CUDA back-end runtime Runtime library related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants