From 35d0e99299cc653c9064026ccbb2b2453483c515 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 10 Jan 2013 08:01:07 +0000 Subject: Added new scons target: cudakernels It's intended to perform compilation of CUDA kernels only, without doing anything with other sources/resources and main purpose of this target is to be able to compile cuda kernels in completely different environment than the rest of blender was compiled. This is needed for linux build environment, where sm_13 compilation fails dramatically in 32bit chroot but could be compiled in 64bit environment. --- SConstruct | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 90c3c45b302..c50240b85e0 100644 --- a/SConstruct +++ b/SConstruct @@ -275,6 +275,9 @@ if 'blenderlite' in B.targets: if k not in B.arguments: env[k] = v +if 'cudakernels' in B.targets: + env['WITH_BF_CYCLES_CUDA_BINARIES'] = True + # Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY and JAckOSX detection for OSX if env['OURPLATFORM']=='darwin': print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'] + " --" @@ -651,6 +654,7 @@ datafileslist = [] datafilestargetlist = [] dottargetlist = [] scriptinstall = [] +cubininstall = [] if env['OURPLATFORM']!='darwin': dotblenderinstall = [] @@ -746,7 +750,7 @@ if env['OURPLATFORM']!='darwin': for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']: kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel') cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch) - scriptinstall.append(env.Install(dir=dir,source=cubin_file)) + cubininstall.append(env.Install(dir=dir,source=cubin_file)) # osl shaders if env['WITH_BF_CYCLES_OSL']: @@ -857,9 +861,9 @@ textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist) if env['OURPLATFORM']=='darwin': allinstall = [blenderinstall, textinstall] elif env['OURPLATFORM']=='linux': - allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall] + allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall, cubininstall] else: - allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall] + allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, cubininstall] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'): dllsources = [] @@ -989,6 +993,20 @@ buildslave_alias = env.Alias('buildslave', buildslave_cmd) Depends(buildslave_cmd, allinstall) +cudakernels_action = env.Action(btools.cudakernels, btools.cudakernels_print) +cudakernels_cmd = env.Command('cudakernels_exec', None, cudakernels_action) +cudakernels_alias = env.Alias('cudakernels', cudakernels_cmd) + +cudakernel_dir = os.path.join(os.path.abspath(os.path.normpath(B.root_build_dir)), 'intern/cycles/kernel') +cuda_kernels = [] + +for x in env['BF_CYCLES_CUDA_BINARIES_ARCH']: + cubin = os.path.join(cudakernel_dir, 'kernel_' + x + '.cubin') + cuda_kernels.append(cubin) + +Depends(cudakernels_cmd, cuda_kernels) +Depends(cudakernels_cmd, cubininstall) + Default(B.program_list) if not env['WITHOUT_BF_INSTALL']: -- cgit v1.2.3 From 2a43380dedd2aec7d5cb0260448e894c22da04fb Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 10 Jan 2013 08:01:19 +0000 Subject: Switch linux buildbot to compile all cuda kernels in 64bit environment Solves memory limit issues when building sm_13 for 32bit platform. Some further refinement of patch could be needed. --- SConstruct | 2 ++ 1 file changed, 2 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index c50240b85e0..49e899c3d20 100644 --- a/SConstruct +++ b/SConstruct @@ -276,7 +276,9 @@ if 'blenderlite' in B.targets: env[k] = v if 'cudakernels' in B.targets: + env['WITH_BF_CYCLES'] = True env['WITH_BF_CYCLES_CUDA_BINARIES'] = True + env['WITH_BF_PYTHON'] = False # Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY and JAckOSX detection for OSX if env['OURPLATFORM']=='darwin': -- cgit v1.2.3 From 93c82483c7bf27f2c067c1dd634940b28074244c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 10 Jan 2013 08:55:44 +0000 Subject: Further tweaks to buildbot - BF_BITNESS should be passed as a command line argument - Made it so CUDA binaries and OSL compiled scripts would be installed regardless WITH_BF_PYTHON (which seems to be quite obvious) - Disable overwrite install, so CUDA kernels installed by it's build target will be preserved when building blender itself. --- SConstruct | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 49e899c3d20..3b1be71aebd 100644 --- a/SConstruct +++ b/SConstruct @@ -746,29 +746,30 @@ if env['OURPLATFORM']!='darwin': source=['intern/cycles/doc/license/'+s for s in source] scriptinstall.append(env.Install(dir=dir,source=source)) - # cuda binaries - if env['WITH_BF_CYCLES_CUDA_BINARIES']: - dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib') - for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']: - kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel') - cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch) - cubininstall.append(env.Install(dir=dir,source=cubin_file)) - - # osl shaders - if env['WITH_BF_CYCLES_OSL']: - dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'shader') - - osl_source_dir = Dir('./intern/cycles/kernel/shaders').srcnode().path - oso_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel/shaders') - - headers='node_color.h node_fresnel.h node_texture.h oslutil.h stdosl.h'.split() - source=['intern/cycles/kernel/shaders/'+s for s in headers] - scriptinstall.append(env.Install(dir=dir,source=source)) + if env['WITH_BF_CYCLES']: + # cuda binaries + if env['WITH_BF_CYCLES_CUDA_BINARIES']: + dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib') + for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']: + kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel') + cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch) + cubininstall.append(env.Install(dir=dir,source=cubin_file)) + + # osl shaders + if env['WITH_BF_CYCLES_OSL']: + dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'shader') + + osl_source_dir = Dir('./intern/cycles/kernel/shaders').srcnode().path + oso_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel/shaders') + + headers='node_color.h node_fresnel.h node_texture.h oslutil.h stdosl.h'.split() + source=['intern/cycles/kernel/shaders/'+s for s in headers] + scriptinstall.append(env.Install(dir=dir,source=source)) - for f in os.listdir(osl_source_dir): - if f.endswith('.osl'): - oso_file = os.path.join(oso_build_dir, f.replace('.osl', '.oso')) - scriptinstall.append(env.Install(dir=dir,source=oso_file)) + for f in os.listdir(osl_source_dir): + if f.endswith('.osl'): + oso_file = os.path.join(oso_build_dir, f.replace('.osl', '.oso')) + scriptinstall.append(env.Install(dir=dir,source=oso_file)) if env['WITH_BF_OCIO']: colormanagement = os.path.join('release', 'datafiles', 'colormanagement') -- cgit v1.2.3