Skip to content

Commit 2d12863

Browse files
author
Jaime Arteaga
authored
[SYCL][UR][L0] Deprecate SYCL_ENABLE_PCI (#10681)
L0 already provides an interface to access PCI information without needing to set an environment variable to access SYSMAN interfaces. --------- Signed-off-by: Jaime Arteaga <[email protected]>
1 parent f11408f commit 2d12863

File tree

7 files changed

+11
-22
lines changed

7 files changed

+11
-22
lines changed

sycl/doc/EnvironmentVariables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Note that conflicting configuration tuples in the same list will favor the last
152152

153153
| Environment variable | Values | Description |
154154
| -------------------- | ------ | ----------- |
155-
| `SYCL_ENABLE_PCI` | Integer | When set to 1, enables obtaining the GPU PCI address when using the Level Zero backend. The default is 0. |
155+
| `SYCL_ENABLE_PCI` (Deprecated) | Integer | When set to 1, enables obtaining the GPU PCI address when using the Level Zero backend. The default is 1. This option is kept for compatibility reasons and is immediately deprecated. |
156156
| `SYCL_PI_LEVEL_ZERO_DISABLE_USM_ALLOCATOR` | Any(\*) | Disable USM allocator in Level Zero plugin (each memory request will go directly to Level Zero runtime) |
157157
| `SYCL_PI_LEVEL_ZERO_TRACK_INDIRECT_ACCESS_MEMORY` | Any(\*) | Enable support of the kernels with indirect access and corresponding deferred release of memory allocations in the Level Zero plugin. |
158158

sycl/plugins/unified_runtime/ur/adapters/level_zero/common.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ ze_structure_type_t getZeStructureType<ze_memory_allocation_properties_t>() {
259259
return ZE_STRUCTURE_TYPE_MEMORY_ALLOCATION_PROPERTIES;
260260
}
261261

262-
template <> zes_structure_type_t getZesStructureType<zes_pci_properties_t>() {
262+
template <> ze_structure_type_t getZeStructureType<ze_pci_ext_properties_t>() {
263+
return ZE_STRUCTURE_TYPE_PCI_EXT_PROPERTIES;
264+
}
265+
266+
template <> zes_structure_type_t getZesStructureType<ze_pci_address_ext_t>() {
263267
return ZES_STRUCTURE_TYPE_PCI_PROPERTIES;
264268
}
265269

sycl/plugins/unified_runtime/ur/adapters/level_zero/device.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -612,12 +612,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
612612
case UR_DEVICE_INFO_DEVICE_ID:
613613
return ReturnValue(uint32_t{Device->ZeDeviceProperties->deviceId});
614614
case UR_DEVICE_INFO_PCI_ADDRESS: {
615-
if (getenv("ZES_ENABLE_SYSMAN") == nullptr) {
616-
urPrint("Set SYCL_ENABLE_PCI=1 to obtain PCI data.\n");
617-
return UR_RESULT_ERROR_INVALID_VALUE;
618-
}
619-
ZesStruct<zes_pci_properties_t> ZeDevicePciProperties;
620-
ZE2UR_CALL(zesDevicePciGetProperties, (ZeDevice, &ZeDevicePciProperties));
615+
ze_pci_address_ext_t PciAddr{};
616+
ZeStruct<ze_pci_ext_properties_t> ZeDevicePciProperties;
617+
ZeDevicePciProperties.address = PciAddr;
618+
ZE2UR_CALL(zeDevicePciGetPropertiesExt, (ZeDevice, &ZeDevicePciProperties));
621619
constexpr size_t AddressBufferSize = 13;
622620
char AddressBuffer[AddressBufferSize];
623621
std::snprintf(AddressBuffer, AddressBufferSize, "%04x:%02x:%02x.%01x",

sycl/plugins/unified_runtime/ur/adapters/level_zero/platform.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGet(
4545
setEnvVar("ZE_ENABLE_PARAMETER_VALIDATION", "1");
4646
}
4747

48-
// Enable SYSMAN support for obtaining the PCI address
49-
// and maximum memory bandwidth.
5048
if (getenv("SYCL_ENABLE_PCI") != nullptr) {
51-
setEnvVar("ZES_ENABLE_SYSMAN", "1");
49+
urPrint("WARNING: SYCL_ENABLE_PCI is deprecated and no longer needed.\n");
5250
}
5351

5452
// TODO: We can still safely recover if something goes wrong during the init.

sycl/test-e2e/Basic/intel-ext-device.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ using namespace sycl;
2626
#endif
2727

2828
int main(int argc, char **argv) {
29-
// Must be enabled at the beginning of the application
30-
// to obtain the PCI address
31-
setenv("SYCL_ENABLE_PCI", "1", 0);
3229

3330
int pltCount = 1;
3431
for (const auto &plt : platform::get_platforms()) {

sycl/test-e2e/DeprecatedFeatures/deprecated_intel_ext_device.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ using namespace sycl;
2929
#endif
3030

3131
int main(int argc, char **argv) {
32-
// Must be enabled at the beginning of the application
33-
// to obtain the PCI address
34-
setenv("SYCL_ENABLE_PCI", "1", 0);
35-
3632
int pltCount = 1;
3733
for (const auto &plt : platform::get_platforms()) {
3834
int devCount = 1;

sycl/test-e2e/Regression/device_pci_address_bdf_format.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ using namespace sycl;
2626
#endif
2727

2828
int main(int argc, char **argv) {
29-
// Must be enabled at the beginning of the application
30-
// to obtain the PCI address
31-
setenv("SYCL_ENABLE_PCI", "1", 0);
32-
3329
// Expected format is "{domain}:{bus}:{device}.{function} where:
3430
// * {domain} is a 4 character hexadecimal value.
3531
// * {bus} is a 2 character hexadecimal value.

0 commit comments

Comments
 (0)