Cycles: scons cuda kernel compile now does one kernel at a time, to reduce memory
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 6 Dec 2011 12:29:54 +0000 (12:29 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 6 Dec 2011 12:29:54 +0000 (12:29 +0000)
usage.

intern/cycles/kernel/SConscript

index c9beb3ad0ae58d65622fc8c67d0975749d388f3c..7749f94818e794a27e7e2b5a3fe229a643fd4467 100644 (file)
@@ -34,6 +34,7 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']:
 
     # dependencies
     dependencies = ['kernel.cu'] + kernel.Glob('*.h') + kernel.Glob('../util/*.h') + kernel.Glob('svm/*.h')
+    last_cubin_file = None
 
     # add command for each cuda architecture
     for arch in cuda_archs:
@@ -46,5 +47,10 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']:
 
         kernel_binaries.append(cubin_file)
 
+        # trick to compile one kernel at a time to reduce memory usage
+        if last_cubin_file:
+            kernel.Depends(cubin_file, last_cubin_file)
+        last_cubin_file = cubin_file
+
 Return('kernel_binaries')