I’m getting a “Segmentation fault” when I call printf and have been chasing this for hours.
unsigned long long *test;
CUDA_CHECK_RETURN(cudaMallocManaged(&test, sizeof(unsigned long long)); //also tried hard-coding the value of “8” instead of sizeof(…)
printf(“Size: %zu”, sizeof(int)); //Displays 4 (Also same result with %d or %u format specifier
printf(“Size: %zu”, sizeof(unsinged long long)); //Displays 549612246768 or sometimes 548685364880 (same result for uint64_t or other specifiers)
*test = 0;
printf("%llu", *test); //Segmentation fault occurs here.
I suspect there’s something else going on, I’m allocating two 2GB blocks using cudaMallocManaged between the declaration and the call to this, but all blocks are uint32_t, float, or unsigned long long (uint64_t).