Skip to content

Conversation

@echuraev
Copy link
Contributor

@echuraev echuraev commented Nov 18, 2022

As it was mentioned in #13362, it would be nice to add check when the user is using a version of libOpenCL.so that is too old.

In this PR we introduce this functionality. In the init method, we traverse through all OpenCL devices and check their version. If the version is older than the target version in TVM, then we notify the user that we will skip this device. We cannot throw any exception from method init because it is possible that you have compiled host code with OpenCL support, but the host device won't have any OpenCL device which is supported by TVM (e.g. they all have too old version of libOpenCL.so or there is no OpenCL driver installed). From OpenCL codegen we call function OpenCLModuleCreate. In the OpenCLModuleCreate init function might be called and in this case an exception will be generated on the host side although that the target device might be supported by TVM. This is why we don't throw any exceptions in the init function.

If in the runtime we use some OpenCL methods and the list of the devices is empty, then we will generate an exception and notify user that possible reason is because version of libOpenCL.so is too old.

As it was mentioned in apache#13362, it would be nice to add check when the
user is using a version of libOpenCL.so that is too old.

In this PR we introduce this functionality. In the `init` method, we
traverse through all OpenCL devices and check their version. If the
version is older than the target version in TVM, then we notify the user
that we will skip this device. We cannot throw any exception from method
`init` because it is possible that you have compiled host code with
OpenCL support, but the host device won't have any OpenCL device which
is supported by TVM (e.g. they all have too old version of
libOpenCL.so). From OpenCL codegen we call function OpenCLModuleCreate.
In the OpenCLModuleCreate init function might be called and in this case
an exception will be generated on the host side although that the target
device might be supported by TVM. This is why we don't throw any
exceptions in the init function.

If in the runtime we use some OpenCL methods and the list of the devices
is empty, then we will generate an exception and notify user that
possible reason is because version of libOpenCL.so is too old.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Nov 18, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@echuraev
Copy link
Contributor Author

cc: @areusch

@masahi masahi merged commit bfb4c00 into apache:main Nov 18, 2022
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
As it was mentioned in apache#13362, it would be nice to add check when the
user is using a version of libOpenCL.so that is too old.

In this PR we introduce this functionality. In the `init` method, we
traverse through all OpenCL devices and check their version. If the
version is older than the target version in TVM, then we notify the user
that we will skip this device. We cannot throw any exception from method
`init` because it is possible that you have compiled host code with
OpenCL support, but the host device won't have any OpenCL device which
is supported by TVM (e.g. they all have too old version of
libOpenCL.so). From OpenCL codegen we call function OpenCLModuleCreate.
In the OpenCLModuleCreate init function might be called and in this case
an exception will be generated on the host side although that the target
device might be supported by TVM. This is why we don't throw any
exceptions in the init function.

If in the runtime we use some OpenCL methods and the list of the devices
is empty, then we will generate an exception and notify user that
possible reason is because version of libOpenCL.so is too old.
@echuraev echuraev deleted the echuraev/improve_opencl_device_version_detection branch April 14, 2023 10:20
@echuraev echuraev restored the echuraev/improve_opencl_device_version_detection branch April 14, 2023 10:21
@echuraev echuraev deleted the echuraev/improve_opencl_device_version_detection branch April 14, 2023 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants