#2844: HelloWorldCuda
Reporter: Anthony Shoup Status: submitted Milestone: ET_2024_11 Version: Type: bug Priority: minor Component: EinsteinToolkit thorn
The HelloWorldCuda thorn does not seem to work in my build of the Einstein Toolkit, ET_2024_11 release. The routine, HelloWorldCUDA_evol, that launches the cuda kernel uses cctk_lsh grid size values that are very large (x-dir > 1x10^9), which then tries to launch too many kernels. Below is the code:
extern "C" void HelloWorldCUDA_evol(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS;
``` const int val1 = cctk_iteration; const int val2 = 3; int res = 42; // poison
const dim3 blockDim(4, 4, 4); ```
// const dim3 gridDim((cctk_lsh[0] + blockDim.x - 1) / blockDim.x, // Commented out by ALS // (cctk_lsh[1] + blockDim.y - 1) / blockDim.y, // (cctk_lsh[2] + blockDim.z - 1) / blockDim.z);
``` // This code does work - ALS const dim3 gridDim((8 + blockDim.x - 1) / blockDim.x, (8 + blockDim.y - 1) / blockDim.y, (8 + blockDim.z - 1) / blockDim.z); add<<<gridDim, blockDim>>>(val1, val2, &res);
cudaError_t cerr = cudaDeviceSynchronize(); // Added by ALS check_error(cerr, "Could not do cuda device synchronize"); // Added by ALS
CCTK_VInfo(CCTK_THORNSTRING, "CUDA says(testing): %d + %d = %d", val1, val2, res); ```
}
-- Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2844/helloworldcuda