Fix T92671: confusing Cycles debug logs about CPU architecture

Instead of printing debug flags listing various CPU and GPU settings that
may or may not be used, print when we are using them. This include CPU
kernel types, OptiX debugging and CUDA and HIP adaptive compilation. BVH
type was already printed.
This commit is contained in:
Brecht Van Lommel 2021-10-31 13:18:28 +01:00
parent 154a060777
commit 806521f703
Notes: blender-bot 2023-02-14 10:43:47 +01:00
Referenced by issue #92671, Wrong CPU Features Detection (AVX)
8 changed files with 19 additions and 40 deletions

View File

@ -157,8 +157,6 @@ static PyObject *init_func(PyObject * /*self*/, PyObject *args)
DebugFlags().running_inside_blender = true;
VLOG(2) << "Debug flags initialized to:\n" << DebugFlags();
Py_RETURN_NONE;
}
@ -885,8 +883,6 @@ static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args)
debug_flags_sync_from_scene(b_scene);
VLOG(2) << "Debug flags set to:\n" << DebugFlags();
debug_flags_set = true;
Py_RETURN_NONE;
@ -896,7 +892,6 @@ static PyObject *debug_flags_reset_func(PyObject * /*self*/, PyObject * /*args*/
{
debug_flags_reset();
if (debug_flags_set) {
VLOG(2) << "Debug flags reset to:\n" << DebugFlags();
debug_flags_set = false;
}
Py_RETURN_NONE;

View File

@ -68,8 +68,7 @@ CPUDevice::CPUDevice(const DeviceInfo &info_, Stats &stats_, Profiler &profiler_
{
/* Pick any kernel, all of them are supposed to have same level of microarchitecture
* optimization. */
VLOG(1) << "Will be using " << kernels.integrator_init_from_camera.get_uarch_name()
<< " kernels.";
VLOG(1) << "Using " << kernels.integrator_init_from_camera.get_uarch_name() << " CPU kernels.";
if (info.cpu_threads == 0) {
info.cpu_threads = TaskScheduler::num_threads();

View File

@ -378,7 +378,9 @@ string CUDADevice::compile_kernel(const uint kernel_features,
cubin.c_str(),
common_cflags.c_str());
printf("Compiling CUDA kernel ...\n%s\n", command.c_str());
printf("Compiling %sCUDA kernel ...\n%s\n",
(use_adaptive_compilation()) ? "adaptive " : "",
command.c_str());
# ifdef _WIN32
command = "call " + command;
@ -405,13 +407,15 @@ string CUDADevice::compile_kernel(const uint kernel_features,
bool CUDADevice::load_kernels(const uint kernel_features)
{
/* TODO(sergey): Support kernels re-load for CUDA devices.
/* TODO(sergey): Support kernels re-load for CUDA devices adaptive compile.
*
* Currently re-loading kernel will invalidate memory pointers,
* causing problems in cuCtxSynchronize.
*/
if (cuModule) {
VLOG(1) << "Skipping kernel reload, not currently supported.";
if (use_adaptive_compilation()) {
VLOG(1) << "Skipping CUDA kernel reload for adaptive compilation, not currently supported.";
}
return true;
}

View File

@ -360,7 +360,9 @@ string HIPDevice::compile_kernel(const uint kernel_features,
source_path.c_str(),
fatbin.c_str());
printf("Compiling HIP kernel ...\n%s\n", command.c_str());
printf("Compiling %sHIP kernel ...\n%s\n",
(use_adaptive_compilation()) ? "adaptive " : "",
command.c_str());
# ifdef _WIN32
command = "call " + command;
@ -387,13 +389,15 @@ string HIPDevice::compile_kernel(const uint kernel_features,
bool HIPDevice::load_kernels(const uint kernel_features)
{
/* TODO(sergey): Support kernels re-load for HIP devices.
/* TODO(sergey): Support kernels re-load for CUDA devices adaptive compile.
*
* Currently re-loading kernel will invalidate memory pointers,
* causing problems in hipCtxSynchronize.
* causing problems in cuCtxSynchronize.
*/
if (hipModule) {
VLOG(1) << "Skipping kernel reload, not currently supported.";
if (use_adaptive_compilation()) {
VLOG(1) << "Skipping HIP kernel reload for adaptive compilation, not currently supported.";
}
return true;
}

View File

@ -91,6 +91,7 @@ OptiXDevice::OptiXDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
};
# endif
if (DebugFlags().optix.use_debug) {
VLOG(1) << "Using OptiX debug mode.";
options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL;
}
optix_assert(optixDeviceContextCreate(cuContext, &options, &context));

View File

@ -807,10 +807,10 @@ bool PathTraceWorkGPU::should_use_graphics_interop()
interop_use_ = device->should_use_graphics_interop();
if (interop_use_) {
VLOG(2) << "Will be using graphics interop GPU display update.";
VLOG(2) << "Using graphics interop GPU display update.";
}
else {
VLOG(2) << "Will be using naive GPU display update.";
VLOG(2) << "Using naive GPU display update.";
}
interop_use_checked_ = true;

View File

@ -99,26 +99,4 @@ void DebugFlags::reset()
optix.reset();
}
std::ostream &operator<<(std::ostream &os, DebugFlagsConstRef debug_flags)
{
os << "CPU flags:\n"
<< " AVX2 : " << string_from_bool(debug_flags.cpu.avx2) << "\n"
<< " AVX : " << string_from_bool(debug_flags.cpu.avx) << "\n"
<< " SSE4.1 : " << string_from_bool(debug_flags.cpu.sse41) << "\n"
<< " SSE3 : " << string_from_bool(debug_flags.cpu.sse3) << "\n"
<< " SSE2 : " << string_from_bool(debug_flags.cpu.sse2) << "\n"
<< " BVH layout : " << bvh_layout_name(debug_flags.cpu.bvh_layout) << "\n";
os << "CUDA flags:\n"
<< " Adaptive Compile : " << string_from_bool(debug_flags.cuda.adaptive_compile) << "\n";
os << "OptiX flags:\n"
<< " Debug : " << string_from_bool(debug_flags.optix.use_debug) << "\n";
os << "HIP flags:\n"
<< " HIP streams : " << string_from_bool(debug_flags.hip.adaptive_compile) << "\n";
return os;
}
CCL_NAMESPACE_END

View File

@ -160,8 +160,6 @@ inline DebugFlags &DebugFlags()
return DebugFlags::get();
}
std::ostream &operator<<(std::ostream &os, DebugFlagsConstRef debug_flags);
CCL_NAMESPACE_END
#endif /* __UTIL_DEBUG_H__ */