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

Write NULL to pointers before using them as a destination for device memory allocation. #2

Merged
merged 1 commit into from
Sep 1, 2012

Conversation

mainland
Copy link
Contributor

On a 64-bit architecture, compiling a GHC program that uses the cuda package
with -O sometimes leaves garbage in the high 4 bytes of device pointers. The
CUDA SDK samples seem to NULL out pointers before using them as a destination
for device memory allocation, but I couldn't find any documentation that this is
required. However, this patch solves all my crashing problems.

…memory allocation.

On a 64-bit architecture, compiling a GHC program that uses the cuda package
with -O sometimes leaves garbage in the high 4 bytes of device pointers. The
CUDA SDK samples seem to NULL out pointers before using them as a destination
for device memory allocation, but I couldn't find any documentation that this is
required. However, this patch solves all my crashing problems.
tmcdonell added a commit that referenced this pull request Sep 1, 2012
Write NULL to pointers before using them as a destination for device memory allocation.
@tmcdonell tmcdonell merged commit 591197a into tmcdonell:master Sep 1, 2012
@tmcdonell
Copy link
Owner

huh, this is odd. I test on a 64-bit ubuntu box, but have not run into this issue before. What machine / SDK version are you running?

@mainland
Copy link
Contributor Author

mainland commented Sep 1, 2012

64-bit Ubuntu 12.04 with the CUDA 4.2 SDK. It only showed up when I compiled with -O though.

mrakgr added a commit to mrakgr/cuda that referenced this pull request Dec 2, 2016
As before, I've modified the file by changing `CUDA_PATH` to `CUDA_PATH_V7_5` and pointed the library directories to the correct location. It might be worth checking out whether like on Windows, Linux also has `CUDA_PATH_V7_5` before accepting this fix.
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.

None yet

2 participants