[Edited] Optix SDK: Enable CPU ?

In the SDK 3.5.1 examples there is an option “-CPU” described as “Enable CPU execution of OptiX programs. The number of threads can be set with --num-devices.”

In the code, it calls “m_scene->enableCPURendering(true)”

If I try this option I get this error:

“Optix Error: Attempting to enable CPU mode, but no CPU device found”

Sound very interesting, it reminds me “CPU Fallback

Comments?

AD

[EDIT2] How to run CUDA in Emulation Mode? Found some hints HERE

[EDIT] The error message derives form HERE:

void
SampleScene::enableCPURendering(bool enable)
{
  // Is CPU mode already enabled
  std::vector<int> devices = m_context->getEnabledDevices();
  bool isCPUEnabled = false;
  for(std::vector<int>::const_iterator iter = devices.begin(); iter != devices.end(); ++iter)
  {
    if (m_context->getDeviceName(*iter) == "CPU") {
      isCPUEnabled = true;
      break;
    }
  }

  // Already in desired state, good-bye.
  if (isCPUEnabled == enable)
    return;

  if (enable)
  {
    // Turn on CPU mode

    int ordinal;
    for(ordinal = m_context->getDeviceCount()-1; ordinal >= 0; ordinal--)
    {
      if (m_context->getDeviceName(ordinal) == "CPU") {
        break;
      }
    }
    if (ordinal < 0)
      throw Exception("Attempting to enable CPU mode, but no CPU device found");
    m_context->setDevices(&ordinal, &ordinal+1);
  } else
  {
    // Turn off CPU mode

    // For now, simply grab the first device
    int ordinal = 0;
    m_context->setDevices(&ordinal, &ordinal+1);
  }

  // Check this here, in case we failed to make it into GPU mode.
  updateCPUMode();
}

OptixError.png

In a question posted by you, CPU mode is not yet there:
https://devtalk.nvidia.com/default/topic/522928/optix/cpu-fallback/

edit:
ah, you even linked there. In this case I have no idea what this thread is about. They will implement new features depending on what people selected in the survey from the 3.5 release.

I know … maybe they can change their mind for the 4.0 release…

;-)