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

CUDA Segfault #612

Closed
danem opened this issue Feb 24, 2017 · 4 comments
Closed

CUDA Segfault #612

danem opened this issue Feb 24, 2017 · 4 comments
Assignees
Milestone

Comments

@danem
Copy link

danem commented Feb 24, 2017

I've encountered this weird bug that I haven't been able to quite track down. I'm trying to use GLM with a program compiled by nvcc 8.0.54. A call glm::lookAt in another source file causes a segfault here. If step through the program with lldb I see the value passed to normalize (ie: center - eye) is null, causing the segfault. Oddly enough I have found that this only segfaults if I reference certain GLM functions in the main cuda source file. Here is a minimal program that demonstrates the behavior.

This is on OSX 10.11.6 using GLM 0.9.8.3.

edit: I've also discovered that if I change the extension of the Camera.cc to Camera.cu everything works nicely. Suggesting the issue has something to do with how nvcc interprets the files.

@blahgeek
Copy link

Hi @danem could you test if #613 fixes your issue? (or you can just go to your .../include/glm/simd/platform.h line 175, change GLM_COMPILER_CUDA to GLM_COMPILER_CUDA80 to see if it works)

@blahgeek
Copy link

#define GLM_FORCE_CXX03 before including glm.hpp also works for me.

@danem
Copy link
Author

danem commented Feb 28, 2017

@blahgeek That did the trick! Thanks! Just as a note, only the first suggestion worked for me, the second suggestion still resulted in a segfault.

@Groovounet Groovounet added this to the GLM 0.9.9 milestone Feb 28, 2017
@Groovounet Groovounet self-assigned this Feb 28, 2017
@Groovounet
Copy link
Member

Thanks @blahgeek for the fix!
Christophe

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

No branches or pull requests

3 participants