Cycles: Switch to HIP SDK 6.4.2 on Windows
This also reverts 367d5b7eabd53229fb7e79465b4761e65e531741, as the math flags workaround is no longer needed. Fix #139796 Fix #138646 Fix #139071 Fix #139070 Ref #140278 Co-authored-by: Brecht Van Lommel <brecht@blender.org> Pull Request: https://projects.blender.org/blender/blender/pulls/145311
This commit is contained in:
committed by
Brecht Van Lommel
parent
af700685e7
commit
03003365cc
@@ -14,7 +14,7 @@ buildbot:
|
|||||||
version: '12.8.0'
|
version: '12.8.0'
|
||||||
hip:
|
hip:
|
||||||
windows:
|
windows:
|
||||||
version: '6.3.42560'
|
version: '6.4.2'
|
||||||
linux:
|
linux:
|
||||||
version: '6.4.0'
|
version: '6.4.0'
|
||||||
optix:
|
optix:
|
||||||
|
|||||||
@@ -263,11 +263,6 @@ string HIPDevice::compile_kernel(const uint kernel_features, const char *name, c
|
|||||||
|
|
||||||
const char *const kernel_ext = "genco";
|
const char *const kernel_ext = "genco";
|
||||||
std::string options = "-Wno-parentheses-equality -Wno-unused-value -ffast-math";
|
std::string options = "-Wno-parentheses-equality -Wno-unused-value -ffast-math";
|
||||||
if (hipNeedPreciseMath(arch)) {
|
|
||||||
options.append(
|
|
||||||
" -fhip-fp32-correctly-rounded-divide-sqrt -fno-gpu-approx-transcendentals "
|
|
||||||
"-fgpu-flush-denormals-to-zero -ffp-contract=off");
|
|
||||||
}
|
|
||||||
|
|
||||||
# ifndef NDEBUG
|
# ifndef NDEBUG
|
||||||
options.append(" -save-temps");
|
options.append(" -save-temps");
|
||||||
|
|||||||
@@ -77,18 +77,6 @@ static inline bool hipIsRDNA2OrNewer(const int hipDevId)
|
|||||||
return (major > 10 || (major == 10 && minor >= 3));
|
return (major > 10 || (major == 10 && minor >= 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool hipNeedPreciseMath(const std::string &arch)
|
|
||||||
{
|
|
||||||
# ifdef _WIN32
|
|
||||||
/* Enable stricter math options for RDNA2 GPUs (compiler bug on Windows). */
|
|
||||||
return (arch == "gfx1030" || arch == "gfx1031" || arch == "gfx1032" || arch == "gfx1033" ||
|
|
||||||
arch == "gfx1034" || arch == "gfx1035" || arch == "gfx1036");
|
|
||||||
# else
|
|
||||||
(void)arch;
|
|
||||||
return false;
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool hipSupportsDeviceOIDN(const int hipDevId)
|
static inline bool hipSupportsDeviceOIDN(const int hipDevId)
|
||||||
{
|
{
|
||||||
/* Matches HIPDevice::getArch in HIP. */
|
/* Matches HIPDevice::getArch in HIP. */
|
||||||
|
|||||||
@@ -225,11 +225,6 @@ string HIPRTDevice::compile_kernel(const uint kernel_features, const char *name,
|
|||||||
options.append(
|
options.append(
|
||||||
"-Wno-parentheses-equality -Wno-unused-value -ffast-math -O3 -std=c++17 -D __HIPRT__");
|
"-Wno-parentheses-equality -Wno-unused-value -ffast-math -O3 -std=c++17 -D __HIPRT__");
|
||||||
options.append(" --offload-arch=").append(arch.c_str());
|
options.append(" --offload-arch=").append(arch.c_str());
|
||||||
if (hipNeedPreciseMath(arch)) {
|
|
||||||
options.append(
|
|
||||||
" -fhip-fp32-correctly-rounded-divide-sqrt -fno-gpu-approx-transcendentals "
|
|
||||||
"-fgpu-flush-denormals-to-zero -ffp-contract=off");
|
|
||||||
}
|
|
||||||
# ifdef WITH_NANOVDB
|
# ifdef WITH_NANOVDB
|
||||||
options.append(" -D WITH_NANOVDB");
|
options.append(" -D WITH_NANOVDB");
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -643,21 +643,6 @@ endif()
|
|||||||
|
|
||||||
# HIP module
|
# HIP module
|
||||||
|
|
||||||
# Workaround for SDK 6.3.42560-881c2d702 compiler bug on RDNA2
|
|
||||||
# Issue #136138
|
|
||||||
function(get_hip_math_flag arch math_flag)
|
|
||||||
if(WIN32 AND (${arch} MATCHES "gfx1030|gfx1031|gfx1032|gfx1033|gfx1034|gfx1035|gfx1036"))
|
|
||||||
set(result
|
|
||||||
-fhip-fp32-correctly-rounded-divide-sqrt
|
|
||||||
-fno-gpu-approx-transcendentals
|
|
||||||
-fgpu-flush-denormals-to-zero
|
|
||||||
-ffp-contract=off)
|
|
||||||
else()
|
|
||||||
set(result "")
|
|
||||||
endif()
|
|
||||||
set(${math_flag} "${result}" PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
|
if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
|
||||||
# build for each arch
|
# build for each arch
|
||||||
set(hip_sources device/hip/kernel.cpp
|
set(hip_sources device/hip/kernel.cpp
|
||||||
@@ -698,8 +683,6 @@ if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
|
|||||||
set(hip_opt_flags)
|
set(hip_opt_flags)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_hip_math_flag(${arch} math_flag)
|
|
||||||
|
|
||||||
set(hip_flags
|
set(hip_flags
|
||||||
${hip_flags}
|
${hip_flags}
|
||||||
--offload-arch=${arch}
|
--offload-arch=${arch}
|
||||||
@@ -716,7 +699,6 @@ if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIP)
|
|||||||
-Wno-unused-value
|
-Wno-unused-value
|
||||||
-ffast-math
|
-ffast-math
|
||||||
-std=c++17
|
-std=c++17
|
||||||
${math_flag}
|
|
||||||
${hip_opt_flags}
|
${hip_opt_flags}
|
||||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${hip_file})
|
-o ${CMAKE_CURRENT_BINARY_DIR}/${hip_file})
|
||||||
|
|
||||||
@@ -812,12 +794,10 @@ if(WITH_CYCLES_HIP_BINARIES AND WITH_CYCLES_DEVICE_HIPRT)
|
|||||||
|
|
||||||
set(hiprt_hipfb)
|
set(hiprt_hipfb)
|
||||||
foreach(arch ${CYCLES_HIP_BINARIES_ARCH})
|
foreach(arch ${CYCLES_HIP_BINARIES_ARCH})
|
||||||
get_hip_math_flag(${arch} math_flag)
|
|
||||||
set(hiprt_file ${CMAKE_CURRENT_BINARY_DIR}/kernel_rt_${arch}.hipfb)
|
set(hiprt_file ${CMAKE_CURRENT_BINARY_DIR}/kernel_rt_${arch}.hipfb)
|
||||||
set(hiprt_file_compressed ${hiprt_file}.zst)
|
set(hiprt_file_compressed ${hiprt_file}.zst)
|
||||||
set(hiprt_flags
|
set(hiprt_flags
|
||||||
${hiprt_compile_flags}
|
${hiprt_compile_flags}
|
||||||
${math_flag}
|
|
||||||
--offload-arch=${arch}
|
--offload-arch=${arch}
|
||||||
-o ${hiprt_file})
|
-o ${hiprt_file})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user