[TEXTURES] - Abnormal GPU Memory Usage on UDIM paths
- Dominant language
- Wolfram Language
- Stars
- 905
- Forks
- 223
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 17
Description
**Summary**
When using udims, without clamping automatic resolution of textures in Viewport 2.0, the GPU Ram spikes, probably because the uber texture generated from the UDIMs is way to big.
**Full Explanation**
We started noticing a lot of errors regarding achieving the GPU Memory limit in the viewport after removing Clamping Texture Resolution "automatic" in our studio. This shouldn't be an issue, since our viewport textures are 512 jpg that doesn't take more than 100Kb. After debugging, I've found that the issue lays in the lookup that mayausd does to generate the uber UDIM texture. Even with a simple plane loading 1 texture, but with the UDIM token, maya tries to find 2048 (weird that it's a power of 2 right) UDIMs as seen on Procmon (see attached texture, it looks until UDIM 3049 so 3049-1001=2048). That results in a spike of around 1.3Gb or so in the GPU, that matches 512x512 (texture size) x 2048 x 2/3/ (not sure if the resulting texture is 2/3 or 4 channel rgb, but the source texture is rgb) aproximately.
I've tried to debug it also with Nvidia Nsight Graphics to try see the resulting texture was but I was unable to capture a frame to debug, however I was able to do it on UsdView and we don't have the issue there, the resulting mipmapped GLTexture takes about 20mb so the issue lays only in the mayaUsd plugin, a default maya vanila file node doesn't raise the issue either. Disabling then textures in the viewport and pausing the viewport and unpausing it afterwards clears the GPU USD texture cache and you can see the RAM drop afterwards.
**Steps to reproduce**
- Create a plane, assign it a texture that has the udim token as usual and set it to UDIM. Eg: test.1001.jpg
- Export it to usd (not necessary, can be any usd, I've attached one with the texture I'm testing just in case). It is important that the asset path of the file in usd has the token.
- Load it in maya with viewport 2 textures disabled, and open the windows task manager
- Enable texture, you should notice the gpu memory raise
**Expected behavior**
The usd textures should not take that much gpu ram and only look for the specific udims
**Attachments**
Procmon lookup:
Ram Spike gif

**Specs (if applicable):**
- Windows 11/10
- Maya 2024.2/ Maya 2026.2
- Maya USD 0.33.0/ 0.34.5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.