Technologist | Entrepreneur | Teammate
TECHNOLOGIST|ENTREPRENEUR|TEAMMATE
3D & Animation
AUGMENTED REALITY VIDEO PRESENTATIONS

Motivation: providing Augmented Reality Video Presentations through a fast and simple production pipeline.

STORTYBOARDING
BLENDER
Getting NVidia GPU acceleration back into Blender on Mac OS X

It is actually simple to get Blender + Cycles + Nvidia/CUDA working on Mac OS X 10.13.6 (High Sierra). It takes 5 steps assuming Xcode is already installed:

  • Install Nvidia CUDA toolkit 10.2 as per Bruno Wego's method.
    
      wget 'https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_mac.dmg' && \
      hdiutil attach cuda_10.2.89_mac.dmg \
          -nobrowse \
          -mountpoint \
          /Volumes/CUDAMacOSXInstaller
    
      open /Volumes/CUDAMacOSXInstaller/CUDAMacOSXInstaller.app
    
      hdiutil detach /Volumes/CUDAMacOSXInstaller && rm ./cuda_10.2.89_mac.dmg
      
  • Prepare for a build on mac os x as per Blender instructions, quick setup. Do the
    make update
    make
    to test the ability to build the CPU version first (and fix whatever is missing until the build works).
  • Fix file blender/intern/cycles/device/cuda/device_cuda_impl.cpp, in function CUDADevice::compile_kernel_get_common_cflags. Add the string "-std=c++14 " as first argument of the string_printf (don't omit the trailing space!). It should look like this:
    
         string cflags = string_printf(
                "-std=c++14 "
                "-m%d "
                "--ptxas-options=\"-v\" "
                "--use_fast_math "
                "-DNVCC "
                "-I\"%s\"",
                machine,
                include_path.c_str());
      
  • Modify the file lib/darwin/nanovdb/include/nanovdb/NanoVDB.h (that's obtained during the make update), fixing all the static_assert calls for which the 1st param is a C++ templatised value that have an extra comma by simply putting the expression in parenthesis, so the non-C++14 compiler don't get confused. This is the diff I got after the fix:
    
          887c887
          <     static_assert(is_same<int, typename CoordT::ValueType>::value, "Expected \"int\" coordinate type");
          ---
          >     static_assert((is_same<int, typename CoordT::ValueType>::value), "Expected \"int\" coordinate type");
          1515,1516c1515,1516
          <     static_assert(is_same<NodeType<0>, LeafNodeType>::value, "NodeType<0> error");
          <     static_assert(is_same<NodeType<3>, RootType>::value, "NodeType<3> error");
          ---
          >     static_assert((is_same<NodeType<0>, LeafNodeType>::value), "NodeType<0> error");
          >     static_assert((is_same<NodeType<3>, RootType>::value), "NodeType<3> error");
          1594c1594
          <     static_assert(is_same<NodeType<NodeT::LEVEL>, NodeT>::value, "Tree::getNode: unvalid node type");
          ---
          >     static_assert((is_same<NodeType<NodeT::LEVEL>, NodeT>::value), "Tree::getNode: unvalid node type");
          1611c1611
          <     static_assert(is_same<NodeType<NodeT::LEVEL>, NodeT>::value, "Tree::getNode: unvalid node type");
          ---
          >     static_assert((is_same<NodeType<NodeT::LEVEL>, NodeT>::value), "Tree::getNode: unvalid node type");
          2425c2425
          <         static_assert(is_same<T, NodeT>::value, "ReadAccessor::getNode: Invalid node type");
          ---
          >         static_assert((is_same<T, NodeT>::value), "ReadAccessor::getNode: Invalid node type");
      
  • Build blender with GPU support for cycles (replace sm_61 by the CUDA Compute level your card supports):
    
      make WITH_CYCLES_CUDA_BINARIES=ON DCYCLES_CUDA_BINARIES_ARCH=sm_61
      

I used the latest git version (commit fa82a15676eb37a7e73d1e3a0e8095684842376d, version 2.92) to build, my system is an aging hackintosh running Xcode 10.1 and WebDrives 387.10.10.10.40.132 (ie, about a year old) with a GTX 1050 Ti and yet the whole thing work just fine.
It's great to be back!

EXPRESSING MOVEMENT AND TIMING
AUTOMATA AS ACTORS
RAY-TRACING
FUNCTION CURVES HELL
EDITING
SHORTER SHORTS