Windows - Blender as a Python Module with Optix: Build Errors


I am successfully building bpy with and without CUDA support.

One build eludes me however: Optix. It leaves me with a very cryptic message, the end of CMake configuration fails with this to say:

-- 64 bit compiler detected.
-- Visual Studio 2017 detected.
-- Found OpenGL: opengl32   
-- Found OpenMP_C: -openmp (found version "2.0") 
-- Found OpenMP_CXX: -openmp (found version "2.0") 
-- Found OpenMP: TRUE (found version "2.0")  
-- Found OptiX: C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.0.0/include  
CMake Error at intern/cycles/CMakeLists.txt:316 (if):
  if given arguments:

    "EQUAL" "8.0"

  Unknown arguments specified

-- Configuring incomplete, errors occurred!
See also "C:/Users/TGubs/Code/Python/blenderpy/build/".
error: command 'C:\\Program Files\\CMake\\bin\\cmake.exe' failed with exit status 1

I’m not sure how to proceed, and am trying to build at 2.82, but Cmakelists.txt does not have this

"EQUAL" "8.0"

Quoted in this way. For example, after checking out v2.82 I get the following:

      set(MAX_MSVC 1900)

Can anyone help explain to me what is going on?

Thanks in advance.

Probably CUDA_VERSION is not set in your CMakeCache.txt? It can be set to whatever the CUDA toolkit version is that you are using, e.g. 10.1 or 10.2.

@brecht pretty sure i have seen this, i think if you have optix on but cubins off it does (or used to do) this, we should probably have better flags checking there

think i fixed this in what git hash are you building off?

Yes, I think this is fixed already.

This seems to be about building v2.82, so maybe a workaround by editing the CMakeCache.txt can help.

Do you think that another possible workaround would be to build Optix WITH_CYCLES_CUDA_BINARIES=ON?

I’m going to try that and see if it helps. I would like to avoid modifying CMake files if I can help it.

Yes, prrior to D7400 landing, WITH_CYCLES_CUDA_BINARIES had to be on if you are building with Optix.

1 Like

Thanks a lot! The build completed, interestingly not much larger than the CUDA build!