Skip to content

Commit 90c8f05

Browse files
authored
[SYCL][CUDA] Disable by default the Image support (#5256)
due to the fact that its actual CUDA implementation is partial. It is possible to re-enable it by setting PI_CUDA_ENABLE_IMAGE_SUPPORT environment variable at runtime.
1 parent 8fa17b4 commit 90c8f05

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,17 @@ variables in production code.</span>
147147
| `SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_D2D_COPY` (experimental) | Integer | Allows the use of copy engine, if available in the device, in Level Zero plugin for device to device copy operations. The default is 0. This option is experimental and will be removed once heuristics are added to make a decision about use of copy engine for device to device copy operations. |
148148
| `SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS` | Any(\*) | Enable support of device-scope events whose state is not visible to the host. If enabled the Level Zero plugin would create all events having device-scope only and create proxy host-visible events for them when their status is needed (wait/query) on the host. The default is 0, meaning all events are host-visible. |
149149

150+
## Debugging variables for CUDA Plugin
151+
152+
:warning: **Warning:** <span style="color:red">the environment variables
153+
described below are used for development and debugging of DPC++ compiler
154+
and runtime. Their semantics are subject to change. Do not rely on these
155+
variables in production code.</span>
156+
157+
| Environment variable | Values | Description |
158+
| -------------------- | ------ | ----------- |
159+
| `SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT` (experimental) | Any(\*) | Enable support of images. This option is experimental since the image support is not fully implemented. |
160+
161+
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
162+
150163
[xpti]: https://github.com/intel/llvm/blob/sycl/xptifw/doc/XPTI_Framework.md

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,20 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
11611161
pi_uint64{max_alloc});
11621162
}
11631163
case PI_DEVICE_INFO_IMAGE_SUPPORT: {
1164+
pi_bool enabled = PI_FALSE;
1165+
1166+
if (std::getenv("SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT") != nullptr) {
1167+
enabled = PI_TRUE;
1168+
} else {
1169+
cl::sycl::detail::pi::cuPrint(
1170+
"Images are not fully supported by the CUDA BE, their support is "
1171+
"disabled by default. Their partial support can be activated by "
1172+
"setting SYCL_PI_CUDA_ENABLE_IMAGE_SUPPORT environment variable at "
1173+
"runtime.");
1174+
}
1175+
11641176
return getInfo(param_value_size, param_value, param_value_size_ret,
1165-
PI_TRUE);
1177+
enabled);
11661178
}
11671179
case PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS: {
11681180
// This call doesn't match to CUDA as it doesn't have images, but instead

0 commit comments

Comments
 (0)