Cycles: Crash on AVX2 processors in some corner cases #50050

Closed
opened 2016-11-16 15:40:28 +01:00 by Sergey Sharybin · 4 comments

System Information

Linux Debian jessie, 64bit, GTX 1080 GPU.

Blender Version

Broken on 2a2eb0c with the following patch applied

P424: (An Untitled Masterwork)

diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 3f4d3e0..6cb68b5 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -596,8 +596,7 @@ ccl_device_inline float len_squared(const float4& a)
 
 ccl_device_inline float3 normalize(const float3& a)
 {
-	/* TODO(sergey): Disabled for now, causes crashes in certain cases. */
-#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) && 0
+#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__)
 	__m128 norm = _mm_sqrt_ps(_mm_dp_ps(a.m128, a.m128, 0x7F));
 	return _mm_div_ps(a.m128, norm);
 #else
@@ -798,8 +797,7 @@ ccl_device_inline float4 operator-(const float4& a)
 
 ccl_device_inline float4 operator*(const float4& a, const float4& b)
 {
-	/* TODO(sergey): Disabled for now, causes crashes in certain cases. */
-#if defined(__KERNEL_SSE__) && 0
+#ifdef __KERNEL_SSE__
 	return _mm_mul_ps(a.m128, b.m128);
 #else
 	return make_float4(a.x*b.x, a.y*b.y, a.z*b.z, a.w*b.w);
@@ -847,8 +845,7 @@ ccl_device_inline float4 operator/(const float4& a, const float4& b)
 
 ccl_device_inline float4 operator+(const float4& a, const float4& b)
 {
-	/* TODO(sergey): Disabled for now, causes crashes in certain cases. */
-#if defined(__KERNEL_SSE__) && 0
+#ifdef __KERNEL_SSE__
 	return _mm_add_ps(a.m128, b.m128);
 #else
 	return make_float4(a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w);
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index ea5eb3b..a0695f2 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -74,7 +74,7 @@ ccl_device_inline float3 transform_perspective(const Transform *t, const float3
 ccl_device_inline float3 transform_point(const Transform *t, const float3 a)
 {
 	/* TODO(sergey): Disabled for now, causes crashes in certain cases. */
-#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) && 0
+#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__)
 	ssef x, y, z, w, aa;
 	aa = a.m128;
 
@@ -103,8 +103,7 @@ ccl_device_inline float3 transform_point(const Transform *t, const float3 a)
 
 ccl_device_inline float3 transform_direction(const Transform *t, const float3 a)
 {
-	/* TODO(sergey): Disabled for now, causes crashes in certain cases. */
-#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) && 0
+#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__)
 	ssef x, y, z, w, aa;
 	aa = a.m128;
 	x = _mm_loadu_ps(&t->x.x);

NOTE: It is important to apply this patch because it removes workarounds which we added to

Short description of error

Crash happens in some corner cases when rendering on AVX2 CPU with Blender compiled in Release mode.

Exact steps for others to reproduce the error

Open one of those files and hit F12. The crash will happen soon after few samples are done.

flythrough_main.blend flythrough_main_rendertest.blend

**System Information** Linux Debian jessie, 64bit, GTX 1080 GPU. **Blender Version** Broken on 2a2eb0c with the following patch applied [P424: (An Untitled Masterwork)](https://archive.blender.org/developer/P424.txt) ``` diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 3f4d3e0..6cb68b5 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -596,8 +596,7 @@ ccl_device_inline float len_squared(const float4& a) ccl_device_inline float3 normalize(const float3& a) { - /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ -#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) && 0 +#if defined(__KERNEL_SSE41__) && defined(__KERNEL_SSE__) __m128 norm = _mm_sqrt_ps(_mm_dp_ps(a.m128, a.m128, 0x7F)); return _mm_div_ps(a.m128, norm); #else @@ -798,8 +797,7 @@ ccl_device_inline float4 operator-(const float4& a) ccl_device_inline float4 operator*(const float4& a, const float4& b) { - /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ -#if defined(__KERNEL_SSE__) && 0 +#ifdef __KERNEL_SSE__ return _mm_mul_ps(a.m128, b.m128); #else return make_float4(a.x*b.x, a.y*b.y, a.z*b.z, a.w*b.w); @@ -847,8 +845,7 @@ ccl_device_inline float4 operator/(const float4& a, const float4& b) ccl_device_inline float4 operator+(const float4& a, const float4& b) { - /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ -#if defined(__KERNEL_SSE__) && 0 +#ifdef __KERNEL_SSE__ return _mm_add_ps(a.m128, b.m128); #else return make_float4(a.x+b.x, a.y+b.y, a.z+b.z, a.w+b.w); diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index ea5eb3b..a0695f2 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -74,7 +74,7 @@ ccl_device_inline float3 transform_perspective(const Transform *t, const float3 ccl_device_inline float3 transform_point(const Transform *t, const float3 a) { /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ -#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) && 0 +#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) ssef x, y, z, w, aa; aa = a.m128; @@ -103,8 +103,7 @@ ccl_device_inline float3 transform_point(const Transform *t, const float3 a) ccl_device_inline float3 transform_direction(const Transform *t, const float3 a) { - /* TODO(sergey): Disabled for now, causes crashes in certain cases. */ -#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) && 0 +#if defined(__KERNEL_SSE__) && defined(__KERNEL_SSE2__) ssef x, y, z, w, aa; aa = a.m128; x = _mm_loadu_ps(&t->x.x); ``` NOTE: It is important to apply this patch because it removes workarounds which we added to **Short description of error** Crash happens in some corner cases when rendering on AVX2 CPU with Blender compiled in Release mode. **Exact steps for others to reproduce the error** Open one of those files and hit F12. The crash will happen soon after few samples are done. [flythrough_main.blend](https://archive.blender.org/developer/F401709/flythrough_main.blend) [flythrough_main_rendertest.blend](https://archive.blender.org/developer/F401705/flythrough_main_rendertest.blend)
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

Added subscriber: @Sergey

Added subscriber: @Sergey
Sergey Sharybin self-assigned this 2016-11-16 15:40:39 +01:00
Author
Owner

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author
Owner

Can no longer reproduce the crash after light threshold and sampling commits. Could be some compiler issue or so.

Enabled all AVX2 optimizations again to see if we hit this bug again.

Can no longer reproduce the crash after light threshold and sampling commits. Could be some compiler issue or so. Enabled all AVX2 optimizations again to see if we hit this bug again.
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
1 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#50050
No description provided.