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

Switching to alpaka::Complex broke TWTS field background #4138

Closed
sbastrakov opened this issue Jun 2, 2022 · 5 comments
Closed

Switching to alpaka::Complex broke TWTS field background #4138

sbastrakov opened this issue Jun 2, 2022 · 5 comments
Assignees
Labels
bug a bug in the project's code component: core in PIConGPU (core application)
Milestone

Comments

@sbastrakov
Copy link
Member

sbastrakov commented Jun 2, 2022

After switching to alpaka::Complex<> in #4114 TWTS fast field background got runtime failures with 'cudaErrorLaunchFailure': 'unspecified launch failure'!. From previous experience that normally means that somehow a host version of a host-device function gets called from the device side.

Probably TWTS has the same issue. When switching, I tested the transition radiation, so in principle complex numbers do work on device side in PIConGPU. I am now suspecting that something wrong is happening with selecting math functions like exp as they are probably only used here for complex numbers. Not sure why exactly that happens here, but there are not that many suspects.

@sbastrakov sbastrakov added bug a bug in the project's code component: core in PIConGPU (core application) labels Jun 2, 2022
@sbastrakov sbastrakov added this to the 0.7.0 / 1.0.0: Next Stable milestone Jun 2, 2022
@sbastrakov sbastrakov self-assigned this Jun 2, 2022
@sbastrakov
Copy link
Member Author

sbastrakov commented Jun 2, 2022

So far it appears that the problem is with some but not all cupla-provided math functions of complex numbers. E.g. using exp() works fine, but once sqrt() is called for a complex number this error occurs. I guess somehow it does not find the correct implementation (not clear why) and so uses a generic alpaka one which in turn tries to fall back on std:: and that fails on the device side.

@sbastrakov
Copy link
Member Author

Discussed offline with @psychocoderHPC , it seems to be a bug in cupla. We think we found a fix, I will try implementing it.

@sbastrakov
Copy link
Member Author

I made a fix in cupla alpaka-group/cupla#235 and checked that it solves this issue. Will keep it open till we get the fixed cupla to dev (we planned to update it anyhow, just will need to add the fix first).

@sbastrakov
Copy link
Member Author

Oh, there is also an unrelated issue in alpaka alpaka-group/alpaka#1731 which also stops TWTS from running with alpaka::Complex. Fix is on its way.

@sbastrakov
Copy link
Member Author

Fixed with #4166 (and fixes to alpaka and cupla that it brings to PIConGPU)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the project's code component: core in PIConGPU (core application)
Projects
None yet
Development

No branches or pull requests

1 participant