I’m currently taking the Getting Started with Accelerated Computing in CUDA C/C++ course, and I’ve encountered an issue during the assessment part.
I’m facing some difficulties, or perhaps I’m missing something important. In that case, I would appreciate it if someone could point me in the right direction and help me understand the mistake I might be making.
Here’s a detailed description of the issue:
I save the 09-nbody/01-nbody.cu file with my solution proposal.
I compile it with the given command on the Notebook !nvcc -std=c++11 -o nbody 09-nbody/01-nbody.cu
I run the cell with the run_assessment() instruction, then I receive the following message:
Running nbody simulator with 4096 bodies
----------------------------------------
Application should run faster than 0.9s
Your application ran in: 0.0772s
Your application reports totalTime 0.000
642.805 Billion Interactions / second
Your results are not correct
I would like to be guided into the acceptance criteria for this final project. Since I believe 0.9s is greater than 0.0772s. Maybe I am failing in other parts of the assessment that are not mentioned here.
Here are a couple of more evidences of my proposal:
Thank you for the response. I’m happy to provide any additional information that might help the DLI team with it. I appreciate your time and assistance.
Hi @federicocusot, thanks so much for reaching out for support.
The message you are seeing, specifically Your results are not correct indicates that the calculations resulting from your code, specifically for the value p are not accurate.
The CPU-only starter file 01-nbody.cu results in the correct values for p, so double check that any refactoring you have done to move the work to the GPU is continuing to calculate the correct p.
After you’ve looked at it a bit more, and if you’re still stuck, please feel free to email me your assessment code and I can take a more careful look at it.
Yup, the issue was indeed related to the p values and the usage of the cudaMallocManaged and cudaMemPrefetchAsync functions. I’ll avoid going into further details to prevent spoilers.