# How to determine what size and how many textures I can use?

**URL:** <https://discourse.julialang.org/t/how-to-determine-what-size-and-how-many-textures-i-can-use/104018>\
**Category:** GPU\
**Created:** [September 19, 2023, 9:20am UTC](https://discourse.julialang.org/t/how-to-determine-what-size-and-how-many-textures-i-can-use/104018 "2023-09-19T09:20:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lodygaw](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@lodygaw](https://discourse.julialang.org/u/lodygaw)\
**Post date:** [September 19, 2023, 9:20am UTC](https://discourse.julialang.org/t/how-to-determine-what-size-and-how-many-textures-i-can-use/104018/1 "2023-09-19T09:20:16Z")

</div>

Hi,  
Is there a way to determine (programmatically) what is the maximum size of 1D texture array for particular device? Is there any limitation how many texture arrays can be used in total?

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [September 19, 2023, 11:04am UTC](https://discourse.julialang.org/t/how-to-determine-what-size-and-how-many-textures-i-can-use/104018/2 "2023-09-19T11:04:53Z")

</div>

> [@lodygaw](#):
>
> Is there a way to determine (programmatically) what is the maximum size of 1D texture array for particular device?

There seems to be a device attribute that matches your question: `DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH`:

```julia
julia> attribute(device(), CUDA.DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH)
131072

```

> [@lodygaw](#):
>
> Is there any limitation how many texture arrays can be used in total?

256, per the compute capability table in [CUDA C++ Programming Guide](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications-technical-specifications-per-compute-capability), but I don’t know of a way to query that programmatically.
