# Cuda texture size limits?

**URL:** <https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423>\
**Category:** CUDA Programming and Performance\
**Created:** [March 18, 2007, 4:57am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423 "2007-03-18T04:57:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JaredHoberock](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jaredhoberock/32/166135_2.png) [@JaredHoberock](https://forums.developer.nvidia.com/u/JaredHoberock)\
**Post date:** [March 18, 2007, 4:57am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/1 "2007-03-18T04:57:15Z")

</div>

Are there size limits to CUDA textures as in OpenGL? If so, what are they on G80?

---

<div class="post-metadata">

**Author:** ![AlexTutubalin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AlexTutubalin](https://forums.developer.nvidia.com/u/AlexTutubalin)\
**Post date:** [March 18, 2007, 5:43am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/2 "2007-03-18T05:43:01Z")

</div>

> [@](#):
>
> Are there size limits to CUDA textures as in OpenGL?&nbsp; If so, what are they on G80?
> 
> [snapback]172736[/snapback]

texture size limits in CUDA is ~~4096x4096~~ 8192x8192

(see another post below)

---

<div class="post-metadata">

**Author:** ![tachyon\_john](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tachyon\_john](https://forums.developer.nvidia.com/u/tachyon_john)\
**Post date:** [March 18, 2007, 7:23am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/3 "2007-03-18T07:23:49Z")

</div>

I’ve used 2-D textures with one of the dimensions as large as 16384, for a float4 texture. I believe the hardware can do 65536 if you are just referencing floats.

John

> [@](#):
>
> texture size limits in CUDA is 4096x4096
> 
> [snapback]172741[/snapback]

---

<div class="post-metadata">

**Author:** ![AlexTutubalin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AlexTutubalin](https://forums.developer.nvidia.com/u/AlexTutubalin)\
**Post date:** [March 18, 2007, 9:11am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/4 "2007-03-18T09:11:33Z")

</div>

> [@](#):
>
> texture size limits in CUDA is 4096x4096
> 
> [snapback]172741[/snapback]

Sorry, I’ve mistaken with DX9 limits.

For CUDA: I was able to use 8192x8192 textures and was unable to use 12288x12288 float texture.

---

<div class="post-metadata">

**Author:** ![Knaxkopp](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Knaxkopp](https://forums.developer.nvidia.com/u/Knaxkopp)\
**Post date:** [March 19, 2007, 9:47am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/5 "2007-03-19T09:47:22Z")

</div>

> [@](#):
>
> For CUDA: I was able to use 8192x8192 textures and was unable to use 12288x12288 float texture.

This is strange. Cyril Zeller wrote (in post http://forums.nvidia.com/index.php?showtop…post&p=169592):

> [@](#):
>
> The maximum width for a texture is 64K and maximum height 32K.

and later in the same thread:

> [@](#):
>
> Texture references bound to linear memory can only be 1D and their maximum width is 2^27.

I asked him if it’s bytes or elements. He wrote that it’s elements, so with a float texture the maximum size is 512MB.

12k^2\*4 byte makes 576 MB for this texture. So maybe there’s a 512MB limit for 2d textures too?

Are you using 8800 GTS. On my GTS I could allocate until 589 MB of linear mem in 1 MB blocks but had problems to do so with big blocks of mem (don’t remember the limit but it could be 512 MB, also I didn’t try with array mem.)

So maybe theres a general 512 MB limit for memory blocks or if you use a GTS there may not enough VRAM left, because of big screen, 2D-GUI, open D3D or OGL viewports …

---

<div class="post-metadata">

**Author:** ![Cyril\_Zeller](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Cyril\_Zeller](https://forums.developer.nvidia.com/u/Cyril_Zeller)\
**Post date:** [March 23, 2007, 4:32am UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/6 "2007-03-23T04:32:59Z")

</div>

The limits I gave in [url=“[The Official NVIDIA Forums | NVIDIA](http://forums.nvidia.com/index.php?showtopic=29545&st=0&p=169592&#entry169592)”][http://forums.nvidia.com/index.php?showtop...92&#entry169592[/url]](http://forums.nvidia.com/index.php?showtop...92&#entry169592%5B/url%5D) are correct, but there is a bug in the current CUDA release that prevents you from allocating big blocks of memory.  
It will be fixed in the next release.

---

<div class="post-metadata">

**Author:** ![garciav](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/garciav/32/9751_2.png) [@garciav](https://forums.developer.nvidia.com/u/garciav)\
**Post date:** [June 10, 2008, 1:56pm UTC](https://forums.developer.nvidia.com/t/cuda-texture-size-limits/423/7 "2008-06-10T13:56:39Z")

</div>

Is this problem fixed? Is it possible to allocate an array of size 65536 x 32768 ?  
It seems that it doesn’t make the GPU crash but the values return seem weird…
