Why CUDA doesn't support 3 channels in texture?

Hi all,

I have defined a type texture, but it seems I cannot use Tex3D() to do texture fetch. Then I checked the texture_fetch_function.h and found no function definition for 3 channel operation, just for 1,2,4 channel. I also checked the channel_descriptor.h, no definition for 3 neither.

So why CUDA doesn’t support 3 channels in texture? Do I need to use a type each time? That would lead to larger memory burden. Is there anybody can help?


Simply because the hardware does not support 3-component textures.

The graphics APIs which offer 3 component texture formats are padded to 4 components by the driver.

I should add this to the FAQ!

Oh, that’s a little frustrated because 3 components structure are so common.

Thanks very much for your reply!


You can often use the fourth component for useful information, especially when using __int_as_float & __float_as_int