Skip to content

[UR] Loader prefilter negative filters behave unexpectedly. #17086

Closed
@aarongreig

Description

@aarongreig

Right now we have some code in the loader which parses ONEAPI_DEVICE_SELECTOR to exclude loading libraries based on the backend components of the filter strings. The intention of this is that you can pass ONEAPI_DEVICE_SELECTOR=opencl:* and the loader will only load the opencl adapter library, which is beneficial because some adapter libraries have side-effects when loaded due to how drivers are implemented.

This code also supports negative filter strings, where you prepend ! to make your filter an anti-pattern. This can cause some strange behaviour because the device type component of the filters is completely ignored. For example, the filter string !opencl:fpga should mean "give me any device that doesn't have the opencl backend and the fpga device type", but our implementation interprets it as !opencl:*, or "give me any device that doesn't have the opencl backend" - which results in the opencl adapter not being loaded and no opencl devices being reported. A worse example is device type only filters: something like !*:cpu should mean "exclude cpu devices", but since the device type is ignored it becomes !*:* - exclude all devices, which results in none of the adapter libraries being loaded.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions