# Error during build, OpenCL kernels core

**URL:** <https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503>\
**Category:** Python\
**Tags:** windows, opencl, build\
**Created:** [June 13, 2023, 6:36pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503 "2023-06-13T18:36:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![esanchez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/esanchez/32/8082_2.png) [@esanchez](https://forum.opencv.org/u/esanchez)\
**Post date:** [June 13, 2023, 6:36pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/1 "2023-06-13T18:36:38Z")

</div>

Hello evenryone,

I’m trying to use the OpenCV with cuda, but i can manage to build the OpenCV through CMake, but the **Build** processo finishes with many erros like:

> D:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): warning MSB8065: Custom build for item E:\OpenCV\builds\CMakeFiles\73fe723e92479b05f06abfab27cdceae\opencl\_kernels\_core.cpp.rule succeeded, but specified output e:\opencv\builds\modules\core\opencl\_kernels\_core.cpp has not been created. This may cause incremental build to work incorrectly.  
> C:\OpenCV\sources\opencv-4.7.0\modules\core\src\arithm.cpp(51,10): fatal error C1083: Cannot open include file: ‘opencl\_kernels\_core.hpp’: No such file or directory

and many other with ‘opencl\_kernels\_\*.hpp’

But also other errors like:

> Done building project opencv\_core.vcxproj – FAILED.  
> LINK : fatal error LNK1181: cannot open input file ‘…..\lib\Release\opencv\_core470.lib’

> Done building project opencv\_hfs.vcxproj – FAILED.  
> Done building project opencv\_img\_hash.vcxproj – FAILED.  
> Done building project opencv\_plot.vcxproj – FAILED.  
> Done building project opencv\_quality.vcxproj – FAILED.  
> Done building project opencv\_cudafilters.vcxproj – FAILED.

and it kept with many other like those.

The entire log is here: [https://textdoc.co/tD6aTXLh3geqo5uk](https://textdoc.co/tD6aTXLh3geqo5uk)

I tried to many tutorials, between them: [Install OpenCV GPU with CUDA for Windows 10 - ThinkInfi](https://thinkinfi.com/install-opencv-gpu-with-cuda-for-windows-10/)

I have it installed:

- Cuda 12.2
- CUDNN
- fresh instalation of Python 3.11
- Vistual Studio 2022 (with Desktop development with C++)
- CMake 3.26.4 opencv and opencv-contrib 4.7.0 (source)

I’m running on a Windows 11 machine with 2060 Super

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 13, 2023, 7:27pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/2 "2023-06-13T19:27:44Z")

</div>

That pastebin appears to eat backslashes.

what source are you building? 4.7.0 release/tag?

is this proper VS 2022 or something else?

how did the cmake configuration step go? did it look okay?

the closest related stuff on the internet I could find is this: [visual studio - Custom Build Tool only builds one item each time I build the project - Stack Overflow](https://stackoverflow.com/questions/74261250/custom-build-tool-only-builds-one-item-each-time-i-build-the-project)

---

<div class="post-metadata">

**Author:** ![laurent.berger](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@laurent.berger](https://forum.opencv.org/u/laurent.berger)\
**Post date:** [June 13, 2023, 7:37pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/3 "2023-06-13T19:37:13Z")

</div>

> [@esanchez](#):
>
> **Build**

delete build repo content and rebuild all

---

<div class="post-metadata">

**Author:** ![esanchez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/esanchez/32/8082_2.png) [@esanchez](https://forum.opencv.org/u/esanchez)\
**Post date:** [June 13, 2023, 8:07pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/4 "2023-06-13T20:07:23Z")

</div>

I edited the post to include this informations hut I have installed:

- Cuda 12.2
- CUDNN
- fresh instalation of Python 3.11
- Vistual Studio 2022 (with Desktop development with C++)
- CMake 3.26.4 opencv and opencv-contrib 4.7.0 (source) release

And there are the log of CMake: [https://textdoc.co/TudfOPlpIzUbGg5s](https://textdoc.co/TudfOPlpIzUbGg5s)

I’m running on a Windows 11 machine with 2060 Super

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [June 14, 2023, 5:35am UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/5 "2023-06-14T05:35:12Z")

</div>

> [@laurent.berger](#):
>
> > [@esanchez](#):
> >
> > **Build**
> 
> delete build repo content and rebuild all

If it doesn’t work after you’ve done this can you post your CMake command line as well as the output from the build (not rebuild) step so I can check it on my machine.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 14, 2023, 6:10am UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/6 "2023-06-14T06:10:37Z")

</div>

that pastebin is for prose only. it fails to present any kind of code or “ASCII art” properly (eats backslashes and other special symbols, not monospace, …). I’d recommend using _anything else_, if you want to be _sure_ that the presented data will be usable.

anyway, nothing caught my eye in the cmake configuration results.

---

<div class="post-metadata">

**Author:** ![esanchez](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/esanchez/32/8082_2.png) [@esanchez](https://forum.opencv.org/u/esanchez)\
**Post date:** [June 22, 2023, 5:30pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503/7 "2023-06-22T17:30:41Z")

</div>

I made a windows frash install and did the installation em english, now everthing went well… So thank you everyone for your help
