I’m trying to create a texture object for block compressed formats with CUDA 12.2.
CUDA introduced dedicated enum members for block compressed texture formats in CUDA 11.5 (e.g. CUarray_format_enum::CU_AD_FORMAT_BC1_UNORM).
I could create a CUDA mipmapped array for 32x32, 6 mipmap levels:
CUDA API Error
Function: cuTexObjectCreate
Error : CUDA_ERROR_INVALID_VALUE(1)
Desc : invalid argument
What is the proper way to create a texture object using a dedicated enum value for block compressed texture?
The descriptions on cudaCreateTextureObject and cuTexObjectCreate seem to say something related:
cudaResourceViewDesc::format specifies how the data contained in the CUDA array or CUDA mipmapped array should be interpreted. Note that this can incur a change in size of the texture data. If the resource view format is a block compressed format, then the underlying CUDA array or CUDA mipmapped array has to have a 32-bit unsigned integer format with 2 or 4 channels, depending on the block compressed format. For ex., BC1 and BC4 require the underlying CUDA array to have a 32-bit unsigned int with 2 channels. The other BC formats require the underlying resource to have the same 32-bit unsigned int format but with 4 channels.
but this description seems outdated because the same has been here since even before CUDA 11.5.
That description seems outdated.
I have the error at cuMipmappedArrayCreate when specifying 2 for BC1 format.
I’m talking about new usage after CUDA 11.5.
So it looks like you were on the right track. I do not use the CUDA driver API (I was the very first user of the CUDA runtime, ca. 2006 and refuse to go back), so you will have to wait for someone familiar with the driver API. I could not find anything relevant in an internet search.
Thanks for the link, but this is old unfortunately.
As I wrote in the first post, as you know, CUDA 11.5 added the dedicated enum for BC textures. It should change the way to create a texture object and I hope it also fixes some mip-map issues that has been in CUDA for a long time.
Isn’t there anyone in NVIDIA knows how to create a texture object for CUDA with block compressed texture with full mip-map levels??
Who made this feature for what?
NVIDIA GPU architecture supports BCn formats natively and already had limited support in CUDA through texture resource views. We now introduce new BC CUDA array formats in the driver and runtime APIs.
However the old style requires us to make the array with 1/4 size and this means we lose the last two mips.
On the other hand, when using (probably) new-style creation, it seems we can specify the actual size to initialize a CUDA array, but an error occurs when creating a texture object.
The bug reporting portal has an aggressive system to prevent rogue behavior. You can start by filing a bug that has relatively little information in it, then you are less likely to trigger the content system/error. For example, provide minimal information plus a link to this forum thread.