use opencl GPU:0 (1st gpu) in OpenCLExecutionContext test cases#19053
use opencl GPU:0 (1st gpu) in OpenCLExecutionContext test cases#19053diablodale wants to merge 1 commit intoopencv:masterfrom diablodale:fix18917-testcase-usegpu0
Conversation
alalek
left a comment
There was a problem hiding this comment.
This change reduces testing code coverage.
I believe it is better to add context configuration as test parameter with these values:
:GPU:0:GPU:1:CPU:0
Note: OpenCV's OpenCL subsystem uses :GPU:0 by default.
|
I'm sure I can make needed changes. What is unclear is the goal. I disagree with your assessment. Previously, the errant test cases tested the 2nd GPU and as a fallback the CPU. The 1st GPU was never tested. Therefore, the test cases I put in this PR increase coverage. They test the 1st GPU and fallback to the CPU. This is an increase. Why? Because now the test cases will run on computers with 1 GPU or 2 GPUs or more. Previously, the code only worked on systems with 2 GPUs (that is a subset of those with 1 or more GPUs). Therefore, this PR tests more computers...a superset...those computers that have 1 or more GPUs. If you want to have the same approach of "test any GPU and fallback to a CPU if available", then this PR does that. Remember, it is not guaranteed that there is a OpenCL CPU-based engine installed. For example, newer Intel graphic drivers do not include the CPU-based OpenCL engine. It is a separate download. It is not always easy to switch OpenCL engines. I've gone pretty deep in the OpenCV code to learn that. The ExecutionContext helps as does the environment variable. After I understand your goal with the test cases, then I can make additional changes. |
|
The first "updated" tests is used to test scenario with 2 OpenCL contexts of 2 different OpenCL devices. "Scope"-based test doesn't really need the requirement with contexts of different devices. |
|
I again need to understand your goals...your intentions. Not an explanation of what the tests did (or not) before this PR or with this PR. When I understand your goals, then I can write new or updated code. My understanding is that you want test cases to exercise code and also pass for the most common scenarios. For example, you don't want an exotic test case that tests 5 GPUs or a test case that exercises code that isn't yet implemented. That is why I made this PR...because requiring 2 GPUs is "exotic". Your testing pipeline has only 1 GPU. Look at the logs at https://pullrequest.opencv.org/buildbot/builders/precommit_opencl/builds/26992/steps/test_core-ippicv-opencl/logs/stdio where is lists only Let me give an example of what I want to learn/understand. Here is a list of example goals:
But there are potential problems with those examples...
Evaluating the existing (pre-PR) test cases:
I recommend that I:
|
|
I found proof in your test pipeline logs of undesired skipping of tests, failures and fallbacks. look at https://pullrequest.opencv.org/buildbot/builders/precommit_opencl_linux/builds/27453/steps/test_core-ippicv-opencl/logs/stdio and search for the test cases like |
Fix #18917 by using GPU:0 instead of GPU:1 in two OpenCLExecutionContext test cases. Otherwise, those test cases are using the 2nd GPU or silently fall-back to using a CPU-based OpenCL runtime.
If the opencv test pipeline and its multiple test platforms do not have 2 GPUs in them, then it is possible all the previous results of these two test cases are results of a fallback CPU device. It is important to check the test results of these two test cases on all the test platforms -- it might be the first time these two test cases run on a GPU.
It successfully runs on my two test machines. However, these two machines have two GPUs each.
Pull Request Readiness Checklist
Patch to opencv_extra has the same branch name.