Getting error when trying to create texture object with linear interpolation enabled

I am running on Fedora with 12.0 CUDA and driver 525.85.12

I would like to create a texture object with linear filtering enabled :

int dimX = 512;
int dimY = 512;
int bits_x,bits_y,bits_z,bits_w;
bits_x = bits_y = bits_z = bits_w = 32;
cudaChannelFormatKind kind = cudaChannelFormatKindUnsigned;
cudaArray *deviceArray;
auto channelDesc = cudaCreateChannelDesc(bits_x, bits_y, bits_z, bits_w,kind);
checkCudaErrors(
        cudaMallocArray(&deviceArray, &channelDesc, dimX, dimY, cudaArrayDefault));
        
cudaResourceDesc texRes;
memset(&texRes, 0, sizeof(cudaResourceDesc));
texRes.resType = cudaResourceTypeArray;
texRes.res.array.array = deviceArray;

cudaTextureDesc texDescr;
memset(&texDescr, 0, sizeof(cudaTextureDesc));

texDescr.normalizedCoords = true;
texDescr.filterMode = cudaFilterModeLinear;

cudaTextureAddressMode addressMode;
texDescr.addressMode[0] = cudaAddressModeMirror;
texDescr.addressMode[1] = cudaAddressModeMirror;
texDescr.readMode = cudaReadModeElementType;

cudaTextureObject_t texture_;
checkCudaErrors(
            cudaCreateTextureObject(&texture_, &texRes, &texDescr, NULL));

But when I run the code above, I get the following error


CUDA error at code=26(cudaErrorInvalidFilterSetting) "cudaCreateTextureObject(&texture_, &texRes, &texDescr, NULL)" 

cross posting: cuda - Getting error when trying to create texture object with linear interpolation enabled - Stack Overflow

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.