diff options
author | Thomas Dinges <blender@dingto.org> | 2021-11-11 00:24:53 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2021-11-11 00:24:53 +0300 |
commit | 040630bb9a634988f45fd9f8e480f39c195ec57b (patch) | |
tree | ba52ff3cfc24d63da7a2b3d3abe199f04047b56d | |
parent | 7689f501e2c3beb3535e4a390971d7b0fde74ee9 (diff) |
Fix wrong device check in HIP kernel compile.
Also cleanup some related code, that was falsely copied from CUDA.
Differential Revision: https://developer.blender.org/D13180
-rw-r--r-- | intern/cycles/device/hip/device_impl.cpp | 20 | ||||
-rw-r--r-- | intern/cycles/device/hip/device_impl.h | 3 |
2 files changed, 9 insertions, 14 deletions
diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index bb0573abf8d..d7f68934b46 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -222,7 +222,6 @@ string HIPDevice::compile_kernel_get_common_cflags(const uint kernel_features) const string include_path = source_path; string cflags = string_printf( "-m%d " - "--ptxas-options=\"-v\" " "--use_fast_math " "-DHIPCC " "-I\"%s\"", @@ -236,8 +235,7 @@ string HIPDevice::compile_kernel_get_common_cflags(const uint kernel_features) string HIPDevice::compile_kernel(const uint kernel_features, const char *name, - const char *base, - bool force_ptx) + const char *base) { /* Compute kernel name. */ int major, minor; @@ -255,13 +253,11 @@ string HIPDevice::compile_kernel(const uint kernel_features, /* Attempt to use kernel provided with Blender. */ if (!use_adaptive_compilation()) { - if (!force_ptx) { - const string fatbin = path_get(string_printf("lib/%s_%s.fatbin", name, arch)); - VLOG(1) << "Testing for pre-compiled kernel " << fatbin << "."; - if (path_exists(fatbin)) { - VLOG(1) << "Using precompiled kernel."; - return fatbin; - } + const string fatbin = path_get(string_printf("lib/%s_%s.fatbin", name, arch)); + VLOG(1) << "Testing for pre-compiled kernel " << fatbin << "."; + if (path_exists(fatbin)) { + VLOG(1) << "Using precompiled kernel."; + return fatbin; } } @@ -298,9 +294,9 @@ string HIPDevice::compile_kernel(const uint kernel_features, # ifdef _WIN32 if (!use_adaptive_compilation() && have_precompiled_kernels()) { - if (major < 3) { + if (!hipSupportsDevice(hipDevId)) { set_error( - string_printf("HIP backend requires compute capability 3.0 or up, but found %d.%d. " + string_printf("HIP backend requires compute capability 10.1 or up, but found %d.%d. " "Your GPU is not supported.", major, minor)); diff --git a/intern/cycles/device/hip/device_impl.h b/intern/cycles/device/hip/device_impl.h index 8d81291d15e..eb832ad828c 100644 --- a/intern/cycles/device/hip/device_impl.h +++ b/intern/cycles/device/hip/device_impl.h @@ -95,8 +95,7 @@ class HIPDevice : public Device { string compile_kernel(const uint kernel_features, const char *name, - const char *base = "hip", - bool force_ptx = false); + const char *base = "hip"); virtual bool load_kernels(const uint kernel_features) override; void reserve_local_memory(const uint kernel_features); |