6 Replies Latest reply on Aug 14, 2018 9:56 PM by xhuang

    Call to glTexStorage3D causes excessive system memory usage


      Hi all,


      using more than a single (mipmap) level in a call to glTexStorage3D() to allocate storage for a 2D texture array causes my application to use a huge amount of system memory. For example, after creating a texture with a resoultion of 64x64 texels and 2048 layers, using GL_RGBA8 and 7 levels for a full mipmap chain, my application's RAM usage goes up to nearly 1.7GB, which I believe is about 25x the theoretical size of the texture! This is the call I use is:


      glTexStorage3D(GL_TEXTURE_2D_ARRAY, 7, GL_RGBA8, 64, 64, 2048);


      I have attached the source code of a minimal application that reproduces the issue. I'm using a RX480 and driver version 17.7.1 (on Windows 10).


      A few observations I have made so far:

      - using only 1 level but the same resolution and layer count hardly uses any RAM at all (certainly less than a 1/7 at the very least)

      - RAM usage doesn't seem to further increase with increasing texture size (tested from 64x64 to 256x256 using different internal formats)

      - trying to create anything larger than 256x256x2048 and 7 levels crashes my application

      - a call to glTexStorage3D with GL_TEXTURE_3D (still using 7 mipmap levels and the same resolution) hardly uses any RAM at all

      - running the code on an NVIDIA GeForce 970 or 840m doesn't cause this huge RAM usage


      So am I provoking this behaviour somehow, or is there something weird going in the driver? In my current research work I need to create up to a few hundred texture arrays so I'm running out of RAM fast at the moment. Any help or hints are greatly appreciated!



        • Re: Call to glTexStorage3D causes excessive system memory usage

          Thank you for the report and the repro you have attached. Before I patch this through, can you clarify which system and what driver version are you currently running? Thanks.

            • Re: Call to glTexStorage3D causes excessive system memory usage

              Thank you for your reply. I have pasted my system information from the Radeon Settings menu below. Please let me know if I can be of any other help. I have also updated my driver since my original report, but the issue still remains.


              System overview:


              Radeon Software Version - 17.7.2

              Radeon Software Edition - Crimson ReLive

              Graphics Chipset - Radeon (TM) RX 480 Graphics

              Memory Size - 8192 MB

              Memory Type - GDDR5

              Core Clock - 1303 MHz

              Windows Version - Windows 10 (64 bit)

              System Memory - 8 GB

              CPU Type - AMD Phenom(tm) II X6 1045T Processor




              Radeon Settings Version - 2017.0720.1902.32426

              Driver Packaging Version - 17.30.1041-170720a-316467C-CrimsonReLive

              Provider - Advanced Micro Devices, Inc.

              2D Driver Version -

              Direct3D® Version -

              OpenGL® Version -

              OpenCL™ Version - 22.19.662.4

              AMD Mantle Version -

              AMD Mantle API Version - 102400

              AMD Audio Driver Version -

              Vulkan™ Driver Version - 1.6.0

              Vulkan™ API Version - 1.0.51




              Graphics Card Manufacturer - Powered by AMD

              Graphics Chipset - Radeon (TM) RX 480 Graphics

              Device ID - 67DF

              Vendor ID - 1002

              SubSystem ID - 3413

              SubSystem Vendor ID - 1462

              Revision ID - C7

              Bus Type - PCI Express 3.0

              Current Bus Settings - PCI Express 2.0 x16

              BIOS Version -

              BIOS Part Number - 113-V34111-F1

              BIOS Date - 2016/11/28 20:38

              Memory Size - 8192 MB

              Memory Type - GDDR5

              Memory Clock - 2000 MHz

              Core Clock - 1303 MHz

              Total Memory Bandwidth - 256 GByte/s

              Memory Bit Rate - 8.00 Gbps

              2D Driver File Path - /REGISTRY/MACHINE/SYSTEM/ControlSet001/Control/Class/{4d36e968-e325-11ce-bfc1-08002be10318}/0000

            • Re: Call to glTexStorage3D causes excessive system memory usage

              Hi invor, did you see this issue on recent driver?