I’m setting up a float texture, and I get the above error when I create the texture object. I’ve set the channel to float4, so I’m not sure why specifying the normalization as float should cause trouble.
I’ve confirmed that my width is appropriately pitched; the texture dims are 4096 x 2048.
cudaResourceDesc resDesc{};
memset(&resDesc, 0, sizeof(resDesc));
resDesc.resType = cudaResourceTypePitch2D;
resDesc.res.pitch2D.devPtr = buf;
resDesc.res.pitch2D.width = texture_dims.x;
resDesc.res.pitch2D.height = texture_dims.y;
resDesc.res.pitch2D.pitchInBytes = rowbytes;
if (texture_is_16f)
resDesc.res.pitch2D.desc = cudaCreateChannelDescHalf4();
else
resDesc.res.pitch2D.desc = cudaCreateChannelDesc<float4>();
cudaTextureDesc texDesc{};
memset(&texDesc, 0, sizeof(texDesc));
texDesc.readMode = cudaReadModeNormalizedFloat;
texDesc.filterMode = cudaFilterModeLinear;
texDesc.addressMode[0] = mirror_edges ? cudaAddressModeMirror : cudaAddressModeBorder;
texDesc.addressMode[1] = mirror_edges ? cudaAddressModeMirror : cudaAddressModeBorder;
texDesc.normalizedCoords = true;
if (!mirror_edges)
for (int i = 0; i < 4; i++) texDesc.borderColor[i] = 0; // black
status = cudaCreateTextureObject(&source_texture, &resDesc, &texDesc, nullptr);
checkCudaErrors(status); // ERROR HERE: cudaErrorInvalidNormSetting
I’m running CUDA 12.4 on Windows 11.