I’m getting errors when I try to build Blender with CUDA support.
The build process works if I don’t try to mess with CUDA, but once I make either of these two changes the errors appear:
cmake -DWITH_CYCLES_CUDA_BINARIES=on .
cmake -DCYCLES_CUDA_BINARIES_ARCH=sm_61 . (I have a Geforce GTX 1060)
I have Cuda version 10.2 installed (There are two patches available for CUDA 10.2 on Windows that bring the version number up to 10.2.1 and 10.2.2, are these used on Blender releases? Or is Blender built with the base 10.2?)
Not sure if it’s relevant but I’m on 2.83 branch building version 2.83.12
Here is the build log:
C:\blender-git\build_windows_Full_x64_vc16_Release>rebuild
C:\blender-git\build_windows_Full_x64_vc16_Release>echo off
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.9.0
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- 64 bit compiler detected.
-- Visual Studio 2019 detected.
-- CUDA nvcc = C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin/nvcc.exe
-- Disabling render tests because tests folder does not exist at C:/blender-git/blender/../lib/tests
-- Configuring done
-- Generating done
-- Build files have been written to: C:/blender-git/build_windows_Full_x64_vc16_Release
Microsoft(R) Build Engine versão 16.9.0+57a23d249 para .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Generating node_add_closure.oso
Generating node_ambient_occlusion.oso
Generating node_anisotropic_bsdf.oso
Generating node_attribute.oso
Generating node_background.oso
Generating node_bevel.oso
Generating node_brick_texture.oso
Generating node_brightness.oso
Generating node_bump.oso
Generating node_camera.oso
Generating node_checker_texture.oso
Generating node_clamp.oso
Generating node_combine_rgb.oso
Generating node_combine_hsv.oso
Generating node_combine_xyz.oso
Generating node_convert_from_color.oso
Generating node_convert_from_float.oso
Generating node_convert_from_int.oso
Generating node_convert_from_normal.oso
Generating node_convert_from_point.oso
Generating node_convert_from_vector.oso
Generating node_diffuse_bsdf.oso
Generating node_displacement.oso
Generating node_vector_displacement.oso
Generating node_emission.oso
Generating node_environment_texture.oso
Generating node_fresnel.oso
Generating node_gamma.oso
Generating node_geometry.oso
Generating node_glass_bsdf.oso
Generating node_glossy_bsdf.oso
Generating node_gradient_texture.oso
Generating node_hair_info.oso
Generating node_scatter_volume.oso
Generating node_absorption_volume.oso
Generating node_principled_volume.oso
Generating node_holdout.oso
Generating node_hsv.oso
Generating node_ies_light.oso
Generating node_image_texture.oso
Generating node_invert.oso
Generating node_layer_weight.oso
Generating node_light_falloff.oso
Generating node_light_path.oso
Generating node_magic_texture.oso
Generating node_map_range.oso
Generating node_mapping.oso
Generating node_math.oso
Generating node_mix.oso
Generating node_mix_closure.oso
Generating node_musgrave_texture.oso
Generating node_noise_texture.oso
Generating node_normal.oso
Generating node_normal_map.oso
Generating node_object_info.oso
Generating node_output_displacement.oso
Generating node_output_surface.oso
Generating node_output_volume.oso
Generating node_particle_info.oso
Generating node_refraction_bsdf.oso
Generating node_rgb_curves.oso
Generating node_rgb_ramp.oso
Generating node_separate_rgb.oso
Generating node_separate_hsv.oso
Generating node_separate_xyz.oso
Generating node_set_normal.oso
Generating node_sky_texture.oso
Generating node_subsurface_scattering.oso
Generating node_tangent.oso
Generating node_texture_coordinate.oso
Generating node_toon_bsdf.oso
Generating node_translucent_bsdf.oso
Generating node_transparent_bsdf.oso
Generating node_value.oso
Generating node_vector_curves.oso
Generating node_vector_math.oso
Generating node_vector_rotate.oso
Generating node_vector_transform.oso
Generating node_velvet_bsdf.oso
Generating node_vertex_color.oso
Generating node_voronoi_texture.oso
Generating node_voxel_texture.oso
Generating node_wavelength.oso
Generating node_blackbody.oso
Generating node_wave_texture.oso
Generating node_white_noise_texture.oso
Generating node_wireframe.oso
Generating node_hair_bsdf.oso
Generating node_principled_hair_bsdf.oso
Generating node_uv_map.oso
Generating node_principled_bsdf.oso
Generating node_rgb_to_bw.oso
Building Custom Rule C:/blender-git/blender/intern/cycles/kernel/shaders/CMakeLists.txt
Generating buildinfo.h_fake, buildinfo.h
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(240
,5): warning MSB8065: Custom build for item "C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\8b5d56c26bfa
623b227a9b4f97891ab5\buildinfo.h_fake.rule" succeeded, but specified output "c:\blender-git\build_windows_full_x64_vc16
_release\source\creator\buildinfo.h_fake" has not been created. This may cause incremental build to work incorrectly. [
C:\blender-git\build_windows_Full_x64_vc16_Release\source\creator\buildinfo.vcxproj]
Building Custom Rule C:/blender-git/blender/source/creator/CMakeLists.txt
Generating filter_sm_30.cubin
ptxas info : 0 bytes gmem
ptxas info : Compiling entry function 'kernel_cuda_filter_finalize' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_finalize
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 63 registers, 388 bytes cmem[0], 20 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_nlm_construct_gramian' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_nlm_construct_gramian
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 62 registers, 12288 bytes smem, 429 bytes cmem[0], 4 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_nlm_normalize' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_nlm_normalize
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 7 registers, 348 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_nlm_update_output' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_nlm_update_output
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 28 registers, 380 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_nlm_calc_weight' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_nlm_calc_weight
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 28 registers, 360 bytes cmem[0], 24 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_nlm_blur' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_nlm_blur
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 40 registers, 360 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_nlm_calc_difference' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_nlm_calc_difference
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 40 registers, 388 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_construct_transform' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_construct_transform
576 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 48 registers, 11264 bytes smem, 401 bytes cmem[0], 12 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_combine_halves' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_combine_halves
104 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 48 registers, 372 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_detect_outliers' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_detect_outliers
104 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 25 registers, 372 bytes cmem[0], 4 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_write_feature' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_write_feature
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 7 registers, 416 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_get_feature' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_get_feature
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 13 registers, 392 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_divide_shadow' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_divide_shadow
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 18 registers, 408 bytes cmem[0], 4 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_convert_from_rgb' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_convert_from_rgb
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 9 registers, 384 bytes cmem[0]
ptxas info : Compiling entry function 'kernel_cuda_filter_convert_to_rgb' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_convert_to_rgb
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 13 registers, 372 bytes cmem[0], 4 bytes cmem[2]
ptxas info : Compiling entry function 'kernel_cuda_filter_copy_input' for 'sm_30'
ptxas info : Function properties for kernel_cuda_filter_copy_input
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info : Used 20 registers, 356 bytes cmem[0]
filter.cu
Generating kernel_sm_30.cubin
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(69): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic< ::float4> ") is not allowed [C:\bl
ender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(69): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(70): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic< ::float4> ") is not allowed [C:\bl
ender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(70): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(69): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic<float> ") is not allowed [C:\blender-g
it\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(69): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(70): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic<float> ") is not allowed [C:\blender-g
it\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(70): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(94): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic_3d< ::float4> ") is not allowed [C:
\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(94): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(95): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic_3d< ::float4> ") is not allowed [C:
\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(95): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(96): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic_3d< ::float4> ") is not allowed [C:
\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(96): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(94): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic_3d<float> ") is not allowed [C:\blende
r-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(94): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(95): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic_3d<float> ") is not allowed [C:\blende
r-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(95): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(96): error : calling a __host__
function("__floorf") from a __device__ function("kernel_tex_image_interp_bicubic_3d<float> ") is not allowed [C:\blende
r-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_cuda.vcxproj]
C:/blender-git/blender/intern/cycles/kernel/..\kernel/kernels/cuda/kernel_cuda_image.h(96): error : identifier "__floor
f" is undefined in device code [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\cycles\kernel\cycles_kernel_c
uda.vcxproj]
20 errors detected in the compilation of "C:/Users/nostromo/AppData/Local/Temp/tmpxft_000018bc_00000000-10_kernel.cpp
1.ii".
kernel.cu
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(240
,5): error MSB8066: Custom build for 'C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_30.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_30.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_35.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_35.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_37.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_37.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_50.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_50.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_52.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_52.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_60.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_60.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_61.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_61.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_70.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_70.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\filter_sm_75.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\b9b223b1f5b40529f93
0142cc3f59788\kernel_sm_75.cubin.rule;C:\blender-git\build_windows_Full_x64_vc16_Release\CMakeFiles\544a216cf5642f4809c
b1e6b231d3065\cycles_kernel_cuda.rule' exited with code 1. [C:\blender-git\build_windows_Full_x64_vc16_Release\intern\c
ycles\kernel\cycles_kernel_cuda.vcxproj]
Building Custom Rule C:/blender-git/blender/source/creator/CMakeLists.txt
buildinfo.c
buildinfoobj.vcxproj -> C:\blender-git\build_windows_Full_x64_vc16_Release\source\creator\buildinfoobj.dir\Release\bu
ildinfoobj.lib