Cycles CPU render limited to 5 float textures #37264

Closed
opened 2013-10-30 19:01:15 +01:00 by Ragnar Brynjúlfsson · 10 comments

Relates to: #36272

%%%--- Operating System, Graphics card ---
Ubuntu 12.04, 64-bit, Nvidia GTX 760

- Blender version with error, and version that worked ---

Error is in Blender 2.68a (sub 0), build revision 58536
Error is also in Blender 2.69 (sub 0), build revision 60991

- Short description of error ---

You cannot render with more than 5 float textures, when using Cycles, both on the GPU and CPU. It will output:
ImageManager::add_image: float image limit reached 5, skipping '/home/ragtag/linear_texture.exr'

This is a limitation introduced with commit 44698, with the svn log message:

"Cycles: float texture support. Due to GPU limitations there are now 95 byte,
and 5 float image textures. For CPU render this limit will be lifted later
on with image cache support. Patch by Mike Farnsworth."

This is a limitation the Fermi architecture, but shouldn't be applied to CPU renders.

For a linear workflow, it's important to be able to use float textures, as you'll often be converting 8-bit sRGB textures to 16-bit linear, and will loose a bit of information if you use 8-bit linear instead.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Create 6 planes
Add 6 diffuse shaders...
...with 6 float textures.
Render in Cycles.
5 planes will render fine, the 6th will be purple.
%%%

**Relates to**: #36272 %%%--- Operating System, Graphics card --- Ubuntu 12.04, 64-bit, Nvidia GTX 760 - Blender version with error, and version that worked --- Error is in Blender 2.68a (sub 0), build revision 58536 Error is also in Blender 2.69 (sub 0), build revision 60991 - Short description of error --- You cannot render with more than 5 float textures, when using Cycles, both on the GPU and CPU. It will output: ImageManager::add_image: float image limit reached 5, skipping '/home/ragtag/linear_texture.exr' This is a limitation introduced with commit 44698, with the svn log message: "Cycles: float texture support. Due to GPU limitations there are now 95 byte, and 5 float image textures. For CPU render this limit will be lifted later on with image cache support. Patch by Mike Farnsworth." This is a limitation the Fermi architecture, but shouldn't be applied to CPU renders. For a linear workflow, it's important to be able to use float textures, as you'll often be converting 8-bit sRGB textures to 16-bit linear, and will loose a bit of information if you use 8-bit linear instead. - Steps for others to reproduce the error (preferably based on attached .blend file) --- Create 6 planes Add 6 diffuse shaders... ...with 6 float textures. Render in Cycles. 5 planes will render fine, the 6th will be purple. %%%

Changed status to: 'Open'

Changed status to: 'Open'

%%%This is a known design limitation at the moment, so I would not consider this a bug, but a item for the todo list.

Your opinion Brecht? %%%

%%%This is a known design limitation at the moment, so I would not consider this a bug, but a item for the todo list. Your opinion Brecht? %%%

%%%If I may agitate as a person used to Mudbox/Mari/Softimage pipeline - working with FP EXR for displacement, normals and very often color maps is a standard.
I've spend last two days wondering why Blender is rendering only some of my textures. Randomly chosen on each re-render. I've been using CPU only as those textures went above my GPU memory limits right away.

I'd say please lift CPU 5-tex limit ASAP or if it is something hard to do please consider providing some info/error to users when they hit the limit. As I said before I spend last two days with multiple UDIM model, eventually changeing all I could to PNGs... but without seeing any info why before I run on this bug report.%%%

%%%If I may agitate as a person used to Mudbox/Mari/Softimage pipeline - working with FP EXR for displacement, normals and very often color maps is a standard. I've spend last two days wondering why Blender is rendering only some of my textures. Randomly chosen on each re-render. I've been using CPU only as those textures went above my GPU memory limits right away. I'd say please lift CPU 5-tex limit ASAP or if it is something hard to do please consider providing some info/error to users when they hit the limit. As I said before I spend last two days with multiple UDIM model, eventually changeing all I could to PNGs... but without seeing any info why before I run on this bug report.%%%

Added subscriber: @bned

Added subscriber: @bned

@brecht: Possible fix. I tested this with 6.hdrs on CPU, rendered ok. GPU still limited to 5.

diff --git a/intern/cycles/kernel/kernel_globals.h b/intern/cycles/kernel/kernel_globals.h
index e60bd6c..18ec474 100644
  - a/intern/cycles/kernel/kernel_globals.h
+++ b/intern/cycles/kernel/kernel_globals.h
@@ -32,7 +32,7 @@ struct OSLShadingSystem;

#endif

 

#define MAX_BYTE_IMAGES 512

  • #define MAX_FLOAT_IMAGES 5
+#define MAX_FLOAT_IMAGES  32
 
 typedef struct KernelGlobals {
 	texture_image_uchar4 texture_byte_images[MAX_BYTE_IMAGES];
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index dcb2845..91aae6f 100644
  - a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -170,7 +170,7 @@ int ImageManager::add_image(const string& filename, void *builtin_data, bool ani
 
 		if(slot == float_images.size()) {
 			/* max images limit reached */
  • if(float_images.size() == TEX_NUM_FLOAT_IMAGES) {
+			if(float_images.size() == tex_num_float_images) {
 				printf("ImageManager::add_image: float image limit reached %d, skipping '%s'\n",
 				       tex_num_float_images, filename.c_str());
 				return -1;
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
index f7be545..cfb47d0 100644
  - a/intern/cycles/render/image.h
+++ b/intern/cycles/render/image.h
@@ -30,7 +30,7 @@ CCL_NAMESPACE_BEGIN
  • define TEX_NUM_IMAGES 95
  • define TEX_IMAGE_BYTE_START TEX_NUM_FLOAT_IMAGES
 
  • #define TEX_EXTENDED_NUM_FLOAT_IMAGES 5
+#define TEX_EXTENDED_NUM_FLOAT_IMAGES	32
  • define TEX_EXTENDED_NUM_IMAGES 512
  • define TEX_EXTENDED_IMAGE_BYTE_START TEX_EXTENDED_NUM_FLOAT_IMAGES
@brecht: Possible fix. I tested this with 6.hdrs on CPU, rendered ok. GPU still limited to 5. ``` diff --git a/intern/cycles/kernel/kernel_globals.h b/intern/cycles/kernel/kernel_globals.h index e60bd6c..18ec474 100644 ``` - a/intern/cycles/kernel/kernel_globals.h ``` +++ b/intern/cycles/kernel/kernel_globals.h @@ -32,7 +32,7 @@ struct OSLShadingSystem; ``` #endif ``` ``` #define MAX_BYTE_IMAGES 512 - #define MAX_FLOAT_IMAGES 5 ``` +#define MAX_FLOAT_IMAGES 32 typedef struct KernelGlobals { texture_image_uchar4 texture_byte_images[MAX_BYTE_IMAGES]; diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp index dcb2845..91aae6f 100644 ``` - a/intern/cycles/render/image.cpp ``` +++ b/intern/cycles/render/image.cpp @@ -170,7 +170,7 @@ int ImageManager::add_image(const string& filename, void *builtin_data, bool ani if(slot == float_images.size()) { /* max images limit reached */ ``` - if(float_images.size() == TEX_NUM_FLOAT_IMAGES) { ``` + if(float_images.size() == tex_num_float_images) { printf("ImageManager::add_image: float image limit reached %d, skipping '%s'\n", tex_num_float_images, filename.c_str()); return -1; diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index f7be545..cfb47d0 100644 ``` - a/intern/cycles/render/image.h ``` +++ b/intern/cycles/render/image.h @@ -30,7 +30,7 @@ CCL_NAMESPACE_BEGIN ``` - define TEX_NUM_IMAGES 95 - define TEX_IMAGE_BYTE_START TEX_NUM_FLOAT_IMAGES ``` ``` - #define TEX_EXTENDED_NUM_FLOAT_IMAGES 5 ``` +#define TEX_EXTENDED_NUM_FLOAT_IMAGES 32 ``` - define TEX_EXTENDED_NUM_IMAGES 512 - define TEX_EXTENDED_IMAGE_BYTE_START TEX_EXTENDED_NUM_FLOAT_IMAGES

This issue was referenced by blender/blender-addons-contrib@1bebdc9ad0

This issue was referenced by blender/blender-addons-contrib@1bebdc9ad0b6174a9aee243ad37fcc20db23791c

This issue was referenced by 1bebdc9ad0

This issue was referenced by 1bebdc9ad0b6174a9aee243ad37fcc20db23791c

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 1bebdc9ad0.

Closed by commit 1bebdc9ad0.

Committed this patch, but bumped it to 1024. GPU render is still limited.

Committed this patch, but bumped it to 1024. GPU render is still limited.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
6 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#37264
No description provided.