Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Total/texture accessible memory by DirectX/Cuda/OpenGL

Can someone please explain the difference in texture memory as used in the context of Cuda as opposed to texture memory used in the context of DirectX. Suppose a graphics card has 512 MB of advertised memory, how is it divided into constant memory/texture memory and global memory.

E.g. I have a tesla card that has totalConstMem as 64KB and totalGlobalMem as 4GB, as queried by cudaGetDeviceProperties, but there is no variable that tells me how much of texture memory is required.

Also, how much is "Texture memory" when accessed via DirectX etc graphics APIs. I don't have experience programming in these APIs, so I don't know how and what kind of memory can they access. But AFAIK, all the memory is access is hardware-cached. Please correct me if I'm wrong.

After KoppeKTop's answer: So does the shared memory act as automatic cache for texture memory in case of CUDA and DirectX both? I don't suppose having another h/w cache would make sense anyway. Does it also mean that if I'm using the whole of shared memory in a kernel, texture memory wouldn't get cached?

Thanks.

like image 711
0fnt Avatar asked Jan 01 '26 22:01

0fnt


1 Answers

Actually, I had never deal with DirectX, but I could explain the situation with CUDA textures. Texture is simple array (cudaArray or pitched array) with cached read-only access, stored in global memory. So, maximum size of one big texture on 512 MB card is 512 Megs (actually a little bit less, but it's not sufficient). It's optimized to accessing data in 2D space (it's cached as 2D slices). Also coordinates and values could be transformed on access (see CUDA Programming Guide for details).

And no, not all memory is cached on access (for CUDA devices with compute capability 1.x). Only constant and texture memory. Devices with compute capability >= 2.0 (Fermi) caches all memory accesses using L1 and L2 caches (or only L2 - it's configurable).

like image 59
KoppeKTop Avatar answered Jan 04 '26 01:01

KoppeKTop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!