[Bf-blender-cvs] [fe06ec8] master: Cycles: Workaround CUDA 6.5.16 error after watertight commit

Sergey Sharybin noreply at git.blender.org
Thu Dec 25 10:17:59 CET 2014


Commit: fe06ec82a91a508b953e14277a97323a6eea901e
Author: Sergey Sharybin
Date:   Thu Dec 25 14:15:37 2014 +0500
Branches: master
https://developer.blender.org/rBfe06ec82a91a508b953e14277a97323a6eea901e

Cycles: Workaround CUDA 6.5.16 error after watertight commit

This issue doesn't happen with 6.5.12 and there's slight piece of hope it'll be
fixed in next toolkit releases..

For now we're forcing CUDA to not inline ray precalculation. This could lead to
some speed regression, but wouldn't expect it to be huge -- this code does not
run that often comparing to actual triangle intersection.

===================================================================

M	intern/cycles/kernel/geom/geom_triangle_intersect.h

===================================================================

diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h
index 049e8f3..5090d55 100644
--- a/intern/cycles/kernel/geom/geom_triangle_intersect.h
+++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h
@@ -49,8 +49,14 @@ typedef struct IsectPrecalc {
 	float Sx, Sy, Sz;
 } IsectPrecalc;
 
-ccl_device_inline void triangle_intersect_precalc(float3 dir,
-                                                  IsectPrecalc *isect_precalc)
+/* Workaround for CUDA toolkit 6.5.16. */
+#ifdef __KERNEL_CPU__
+ccl_device_inline
+#else
+ccl_device_noinline
+#endif
+void triangle_intersect_precalc(float3 dir,
+                                 IsectPrecalc *isect_precalc)
 {
 	/* Calculate dimension where the ray direction is maximal. */
 	int kz = util_max_axis(make_float3(fabsf(dir.x),




More information about the Bf-blender-cvs mailing list