Cuda Compile Error Windows 10

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

I have to second this problem. But i am on Master, newest version. Means 2.93 Alpha. Cuda compilation also fails for me on Windows 10 Pro with VS 2019. First i thought it’s because of the new libs, and that a newer Cuda version is required now. But it also fails with Cuda 11.2.

Curiosu enough, it seems to work at Ubuntu. My custom build compiled without any issues. But the Windows version not.

I suspect there is a compatibility issue with CUDA and Visual Studio 2019 v16.9, which was released a few days ago.

We’ll have to investigate, check if it’s something we can fix on our side, and/or report to Microsoft and NVIDIA.

Thanks brecht! Going back to VS2019 v16.8.6 got rid of the errors and I was able to build with CUDA support.

If anyone needs the link to get previous VS2019 versions: https://docs.microsoft.com/en-us/visualstudio/releases/2019/history#installing-an-earlier-release

Is there any way to keep track of VS, cmake, SlikSVN, GIT and CUDA versions used to build the official releases to avoid this kind of error?

I was short on time, so only took a quick peek.

<cmath> started including a file called intrin0.h which has a cpu protype for the float floor(float); that somehow gets selected as the best candidate while building the cuda cycles kernels leading to the error.

Possible workaround for this would be to explicitly use floorf rather than floor when used with a float which surprisingly is seemingly only used in kernel_cuda_image.h

index 82ad9225fc3..132653fa7ca 100644
--- a/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h
+++ b/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h
@@ -68,8 +68,8 @@ ccl_device T kernel_tex_image_interp_bicubic(const TextureInfo &info, float x, f
   x = (x * info.width) - 0.5f;
   y = (y * info.height) - 0.5f;
 
-  float px = floor(x);
-  float py = floor(y);
+  float px = floorf(x);
+  float py = floorf(y);
   float fx = x - px;
   float fy = y - py;
 
@@ -95,9 +95,9 @@ ccl_device T kernel_tex_image_interp_tricubic(const TextureInfo &info, float x,
   y = (y * info.height) - 0.5f;
   z = (z * info.depth) - 0.5f;
 
-  float px = floor(x);
-  float py = floor(y);
-  float pz = floor(z);
+  float px = floorf(x);
+  float py = floorf(y);
+  float pz = floorf(z);
   float fx = x - px;
   float fy = y - py;
   float fz = z - pz;
@@ -127,9 +127,9 @@ ccl_device T kernel_tex_image_interp_tricubic(const TextureInfo &info, float x,
 template<typename T, typename S>
 ccl_device T kernel_tex_image_interp_tricubic_nanovdb(S &s, float x, float y, float z)
 {
-  float px = floor(x);
-  float py = floor(y);
-  float pz = floor(z);
+  float px = floorf(x);
+  float py = floorf(y);
+  float pz = floorf(z);
   float fx = x - px;
   float fy = y - py;
   float fz = z - pz;

Seems to fix the build error for me (and still builds cpu/cuda/optix, have not tested opencl) , but I lacked time to actually run the unit tests. I’m expecting it to be ok, but cannot guarantee it.

2 Likes

Many thanks friends.
I can confirm that the compilation works with these changes. No more errors. And it renders also fine and without errors with cuda and optix.

Just curious, and since i have updated to cuda_11.2.1_461.09_win10 and Optix 7.2.0 to investigate into this problem. Are there any known issues besides that Cuda 11.2 is not yet officially supported? Or should i go back to Cuda 11.1? As told, the render results seems to be fine.
Kind regards
Arunderan

I committed the fix to the master, 2.83 and 2.92 branches.

There are no known issues with newer CUDA or OptiX versions.

2 Likes

this fix the issue for me, but my original problem is dlib.DLIB_USE_CUDA always give False, which needed to be true. Anyone got a solution for me?

I think you are in the wrong topic? This problem only occurred with MSVC which decisively doesn’t have dlib’s :slight_smile:

Thank you very much, that helped me to install dlib I had the same error, I wanted to install dlib with cuda support and it gives me the same error on cuda_dlib.cu I changed the floor with floorf and it was well compiled

I think asking on dlib’s repository would get you more help as they would know more about that specific issue. In fact, IIRC, it is mentioned in dlib’s faq.

A post was split to a new topic: CUDA compiler error: could not set up environment