Skip to content

Commit b0411f8

Browse files
authored
[SYCL] Prevent fallback assert postprocessor being passed to CUDA and HIP devices (intel#4604)
This patch fixes an error with HIP backend where tests DeviceCodeSplit/split-per-kernel.cpp and DeviceCodeSplit/split-per-source-main.cpp fail with `Memory access fault by GPU node-4 (Agent handle: 0x709c50) on address (nil). Reason: Page not present or supervisor privilege.` This is due to a postprocessor being sent to `queue_impl::submit_impl`. The patch add checks to `queue.hpp` so postprocessors needed for fallback assert do not get passed for HIP and CUDA devices. Neither currently support fallback asserts. Note: adding `__AMDGCN__` to ``` #if !defined(SYCL_DISABLE_FALLBACK_ASSERT) && !defined(__NVPTX__) #define __SYCL_USE_FALLBACK_ASSERT 1 #else #define __SYCL_USE_FALLBACK_ASSERT 0 #endif ``` was not a fix as a new error arose in its place. Investigation showed that macros `__AMDGCN__` and `__NVPTX__` are only set for device compilation and as a result did not stop preprocessors being passed to `submit_impl`. I think the postprocesor was not supposed to be passed to CUDA devices. Despite being passed it was not causing an error for CUDA just HIP.
1 parent f844f70 commit b0411f8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sycl/plugins/hip/pi_hip.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,16 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name,
14281428
return getInfo(param_value_size, param_value, param_value_size_ret, "");
14291429
}
14301430
case PI_DEVICE_INFO_EXTENSIONS: {
1431-
return getInfo(param_value_size, param_value, param_value_size_ret, "");
1431+
// TODO: Remove comment when HIP support native asserts.
1432+
// DEVICELIB_ASSERT extension is set so fallback assert
1433+
// postprocessing is NOP. HIP 4.3 docs indicate support for
1434+
// native asserts are in progress
1435+
std::string SupportedExtensions = "";
1436+
SupportedExtensions += PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT;
1437+
SupportedExtensions += " ";
1438+
1439+
return getInfo(param_value_size, param_value, param_value_size_ret,
1440+
SupportedExtensions.c_str());
14321441
}
14331442
case PI_DEVICE_INFO_PRINTF_BUFFER_SIZE: {
14341443
// The minimum value for the FULL profile is 1 MB.

0 commit comments

Comments
 (0)