Texture - Full Vram #121482

Closed
opened 2024-05-06 14:55:40 +02:00 by William-Asperti · 14 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.40

Blender Version
Broken: version: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked: (newest version of Blender that worked as expected)

Short description of error
Hi, i have a big problem like all people with full vram...
I try to render a bedroom with 650mb of texture, and take 7.8gb of vram
Than, i render the same file, but with jpg texture that weight 150mb all... but take me 8.1gb vram

IDK why, but with texture that way less, use more vram, how is possible?
My problem is that i have 100 prop with 4K texture in a bedroom, for a production series, and cycle is fast, but i can't render a lot of object in the same scene

I also see, that if i render the bedroom without texture, take 4gb of vram (full white, with material override)... With 650mb of texture, take 8gb of vram.. Why 650mb of texture begin 4gb?

How blender studio render big scene? i see that there isn't a .tx file in blender to optimize the resolution of texture based on the distance from the camera, like redshift or arnold... This is a foundamentals thinks for use blender in a production series, i think...

What can i do? I can use simplify and load alla texture in 2K, but if i must render in 4K this solution is wrong, i can lost resolution to render 2K texture object in 4K

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.40 **Blender Version** Broken: version: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: (newest version of Blender that worked as expected) **Short description of error** Hi, i have a big problem like all people with full vram... I try to render a bedroom with 650mb of texture, and take 7.8gb of vram Than, i render the same file, but with jpg texture that weight 150mb all... but take me 8.1gb vram IDK why, but with texture that way less, use more vram, how is possible? My problem is that i have 100 prop with 4K texture in a bedroom, for a production series, and cycle is fast, but i can't render a lot of object in the same scene I also see, that if i render the bedroom without texture, take 4gb of vram (full white, with material override)... With 650mb of texture, take 8gb of vram.. Why 650mb of texture begin 4gb? How blender studio render big scene? i see that there isn't a .tx file in blender to optimize the resolution of texture based on the distance from the camera, like redshift or arnold... This is a foundamentals thinks for use blender in a production series, i think... What can i do? I can use simplify and load alla texture in 2K, but if i must render in 4K this solution is wrong, i can lost resolution to render 2K texture object in 4K **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)]
William-Asperti added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-05-06 14:55:41 +02:00

Can you added simple example file?

Can you added simple example file?
Member

Hi @William-Asperti , Blender will decompress all the images into actual pixel data into the VRam. 650MB->4GB sounds reasonably fine for a png/jpg. If 8GB is your video card limit, then it's perfectly reasonable to lower the texture resolution for objects that are much farther away.

If you have to do 4k texture, then if you have enough memory in your CPU side, you might need to consider rendering those intensive frames in CPU.

Hi @William-Asperti , Blender will decompress all the images into actual pixel data into the VRam. 650MB->4GB sounds reasonably fine for a png/jpg. If 8GB is your video card limit, then it's perfectly reasonable to lower the texture resolution for objects that are much farther away. If you have to do 4k texture, then if you have enough memory in your CPU side, you might need to consider rendering those intensive frames in CPU.

Sorry, i can't
but the problem isn't in my specific case, but in blender... how can i render 100 prop with 4K PBR texture?

Sorry, i can't but the problem isn't in my specific case, but in blender... how can i render 100 prop with 4K PBR texture?
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2024-05-06 15:30:19 +02:00

i ask to myself, how is possible that blender not optimized texture like redshift, arnold, renderman... I must reduce the texture size manually? this is impossible in a production series.. The SET must work in 360° there isn't a prop that in all shot are far awey from the camera

I'm actually working on this animation series https://www.formatbiz.it/dettNews.aspx?id=10979. in maya, with 60 UDIM 4K only for the ground... probably 20gb for all textures, without count poligon, fur, and grass scatter with mash....
In blender with only a bedroom with 100 prop i can't lunch a render

Yes CPU work.. but i can't wait 1 hourse for a single frame

Blender is fast, but not optimized for large scene

i ask to myself, how is possible that blender not optimized texture like redshift, arnold, renderman... I must reduce the texture size manually? this is impossible in a production series.. The SET must work in 360° there isn't a prop that in all shot are far awey from the camera I'm actually working on this animation series https://www.formatbiz.it/dettNews.aspx?id=10979. in maya, with 60 UDIM 4K only for the ground... probably 20gb for all textures, without count poligon, fur, and grass scatter with mash.... In blender with only a bedroom with 100 prop i can't lunch a render Yes CPU work.. but i can't wait 1 hourse for a single frame Blender is fast, but not optimized for large scene
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2024-05-06 15:39:43 +02:00

And not understand why, if i change the texture format and lost 400mb of weight texture, increase the vram usage instead of decreasing

And not understand why, if i change the texture format and lost 400mb of weight texture, increase the vram usage instead of decreasing
Member

@William-Asperti as @ChengduLittleA pointed out, Cycles uses uncompressed textures. What does that mean? It means the size of the raw image is how much space the texture will take up in memory. Not the compressed size.

Take for example a 4096x4096 image with RGBA data with 8 bits per channel. The amount of memory it will take up is width x height x number of channels x bits per channel. So 4096 x 4096 x 4 x 8 = 536,870,912 bits (Roughly 64 Megabytes)

And if I test this with Cycles, this is the result I get.

Details on how to test this with Cycles
  1. Open a command prompt
  2. Run /path/to/blender -- --cycles-print-stats
  3. Add a texture you want to test.
  4. Start a render with the CPU then cancel it or wait for it to end.
  5. Memory statistics will be printed to the command line.

But my file is only a 1 Megabyte PNG, So why is it taking up 64 Megabytes of space in Cycles? Because Cycles works with the raw pixel data while rendering, not the compressed image. So it doesn't matter how small your compressed image is, as long as it's 4096x4096 with 8 bits per channel with 4 channels, then it will be consume 64 Megabytes of space.


Is there a way to resolve this? Like can the compressed images be used directly? Technically yes, but they would need to be uncompressed very time they are used, which could significantly slow down rendering time.

GPUs typically have a way to store some types of compressed textures in VRAM and use them, but to my knowledge Cycles doesn't use that feature yet.


I'm not sure if this is a feature of OIIO or OSL, but on-demand texture loading or mip-mapping could be used to reduce memory usage. But this feature is only available on the CPU at the moment (most likely due to technically issues supporting it on the GPU).


Overall, I would consider high VRAM usage from textures to not be a bug. It could be improved, since it's not a bug, I will be closing this bug report.


i see that there isn't a .tx file in blender to optimize the resolution of texture based on the distance from the camera

I believe Blender does have tx support. But I don't think the memory saving features are implemented yet.

How blender studio render big scene?

By optimizing scenes to reduce memory usage down to what fits within their RAM/VRAM constraints. Along with having computers with more RAM/VRAM than what you may have.

@William-Asperti as @ChengduLittleA pointed out, Cycles uses uncompressed textures. What does that mean? It means the size of the raw image is how much space the texture will take up in memory. Not the compressed size. Take for example a 4096x4096 image with RGBA data with 8 bits per channel. The amount of memory it will take up is `width x height x number of channels x bits per channel`. So `4096 x 4096 x 4 x 8 = 536,870,912 bits (Roughly 64 Megabytes)` And if I test this with Cycles, this is the result I get. <details> <summary><b>Details on how to test this with Cycles</b></summary> 1. Open a command prompt 2. Run `/path/to/blender -- --cycles-print-stats` 3. Add a texture you want to test. 4. Start a render with the CPU then cancel it or wait for it to end. 5. Memory statistics will be printed to the command line. </details> But my file is only a 1 Megabyte PNG, So why is it taking up 64 Megabytes of space in Cycles? Because Cycles works with the raw pixel data while rendering, not the compressed image. So it doesn't matter how small your compressed image is, as long as it's 4096x4096 with 8 bits per channel with 4 channels, then it will be consume 64 Megabytes of space. --- Is there a way to resolve this? Like can the compressed images be used directly? Technically yes, but they would need to be uncompressed very time they are used, which could significantly slow down rendering time. GPUs typically have a way to store some types of compressed textures in VRAM and use them, but to my knowledge Cycles doesn't use that feature yet. --- I'm not sure if this is a feature of OIIO or OSL, but on-demand texture loading or mip-mapping could be used to reduce memory usage. But this feature is only available on the CPU at the moment (most likely due to technically issues supporting it on the GPU). --- Overall, I would consider high VRAM usage from textures to not be a bug. It could be improved, since it's not a bug, I will be closing this bug report. --- > i see that there isn't a .tx file in blender to optimize the resolution of texture based on the distance from the camera I believe Blender does have tx support. But I don't think the memory saving features are implemented yet. > How blender studio render big scene? By optimizing scenes to reduce memory usage down to what fits within their RAM/VRAM constraints. Along with having computers with more RAM/VRAM than what you may have.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2024-05-07 05:34:57 +02:00
Member

And not understand why, if i change the texture format and lost 400mb of weight texture, increase the vram usage instead of decreasing

This is a separate issue, please create a new bug report for that and provide example files.

> And not understand why, if i change the texture format and lost 400mb of weight texture, increase the vram usage instead of decreasing This is a separate issue, please create a new bug report for that and provide example files.

@Alaska
Hi, thanks wor your explanation.
I try to run blender from CMD and i see the 3 texture loaded, but not the memory statistic

@Alaska Hi, thanks wor your explanation. I try to run blender from CMD and i see the 3 texture loaded, but not the memory statistic
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2024-05-07 09:22:42 +02:00
Member

To get the memory statistics, you need to run Blender with /path/to/blender -- --cycles-print-stats and render a scene on the CPU.

I should note not all memory statistics are tracked here. Texture memory usage and geometry memory usage is printed here, but BVH and state memory usage is not (state usage can get quite large on some GPUs)

To get the memory statistics, you need to run Blender with `/path/to/blender -- --cycles-print-stats` and render a scene on the CPU. I should note not all memory statistics are tracked here. Texture memory usage and geometry memory usage is printed here, but BVH and state memory usage is not (state usage can get quite large on some GPUs)

sorry i'm a 3D artist, not a programmer
this is what i wrote in CMD "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe" can you write the right string that i can past in cmd

i try this "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe -- --cycles-print-stats" but not work

one other things 4096 x 4096 x 4 x 8 = not is 67,108,864 but 536.870.912 .... ??
Are you sure blender also takes bits into account? Because 4096 x 4096 x 4 is 67,108,864

sorry i'm a 3D artist, not a programmer this is what i wrote in CMD "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe" can you write the right string that i can past in cmd i try this "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe -- --cycles-print-stats" but not work one other things 4096 x 4096 x 4 x 8 = not is 67,108,864 but 536.870.912 .... ?? Are you sure blender also takes bits into account? Because 4096 x 4096 x 4 is 67,108,864
Member

i try this "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe -- --cycles-print-stats" but not work

That should work.

one other things 4096 x 4096 x 4 x 8 = not is 67,108,864 but 536.870.912 .... ??
Are you sure blender also takes bits into account? Because 4096 x 4096 x 4 is 67,108,864

Sorry, I forgot to include bits in my calculation. You're correct. It's 536,870,912 bits which is roughly 64 Megabytes. I have updated by comment to reflect that.

> i try this "C:\Program Files\Blender Foundation\Blender 4.0\blender.exe -- --cycles-print-stats" but not work That should work. > one other things 4096 x 4096 x 4 x 8 = not is 67,108,864 but 536.870.912 .... ?? > Are you sure blender also takes bits into account? Because 4096 x 4096 x 4 is 67,108,864 Sorry, I forgot to include bits in my calculation. You're correct. It's 536,870,912 bits which is roughly 64 Megabytes. I have updated by comment to reflect that.

Ok, i run blender correctly...

Last question... why if i export from substance to 3 channel... the final texture have 4 channel
1 channel are 16mb... 16x3 (RGB are 3) in 48. 16x4 is 64 mb

There is a way to have an image in RGB 48mb instead of RGB 64mb?

Ok, i run blender correctly... Last question... why if i export from substance to 3 channel... the final texture have 4 channel 1 channel are 16mb... 16x3 (RGB are 3) in 48. 16x4 is 64 mb There is a way to have an image in RGB 48mb instead of RGB 64mb?
Member

I don't know why a three channel image is loaded as if it has 4 channels of data. I assume Cycles is creating a "empty" or "constant" alpha channel, but I don't know why.

I don't know why a three channel image is loaded as if it has 4 channels of data. I assume Cycles is creating a "empty" or "constant" alpha channel, but I don't know why.
Member

hi, as @Alaska explained above, high VRAM usage seems expected regardless of compressed image in cycles render.
I think we can close this report.

hi, as @Alaska explained above, high VRAM usage seems expected regardless of compressed image in cycles render. I think we can close this report.
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2024-05-08 07:53:19 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#121482
No description provided.