Hello,
in my code, I check that a pointer points to a host-pinned memory using the cudaPointerGetAttributes() API function. On Linux/Win64 this works just fine (it returns cudaSuccess
and cudaMemoryTypeHost
as attributes.type) but the 32-bit build on Windows (cross-compiled x86_32 on x86_64) always returns 1
=> cudaErrorInvalidValue
.
My PC: Windows10 19.09 18363.1256, GeForce RTX3070, VisualStudio2019, CUDA 11.0.3, driver version 460.89
I also tried other machines with multiple CUDA versions: 11.0, 10.2, 9.2, multiple VS versions: VS2013, VS2015, VS2019, multiple GPUs: GeForce RTX3070, Quadro RTX4000, Titan XP (Pascal) and multiple driver versions: 460.89, 432.00
Then I thought maybe I’m using it somehow incorrectly so I modified the official CUDA11.0 sample - 1_Utilities\bandwidthTest
by adding debug prints
cudaPointerAttributes attributes;
cudaError_t status = cudaPointerGetAttributes(&attributes, h_idata);
printf("cudaPointerGetAttributes status: %d attributes.type %d\n", status, attributes.type);
after the cudaHostAlloc() function found in the sample but the result was the same - 32-bit Windows build again returned cudaErrorInvalidValue
even though the sample finished just fine with the same bandwidth as Win64-bit build (so the host-pinning itself works fine on 32-bit).
Is this a bug or is this an undocumented limitation of Win32 Cuda runtime? Any other ideas? Thanks.