Bug report #21211

Build errors due to "CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120 or 200). It will be set to 200"

Added by Johannes Kroeger almost 6 years ago. Updated over 5 years ago.

Status:Rejected
Priority:Normal
Assignee:Alessandro Pasotti
Category:Build/Install
Affected QGIS version:3.5(master) Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:29029

Description

...
[ 24%] Building CXX object src/core/CMakeFiles/qgis_core.dir/gps/moc_qgsqtlocationconnection.cpp.o
make[2]: *** No rule to make target '/usr/lib/libOpenCL.so', needed by 'output/lib/libqgis_core.so.3.5.0'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 24%] Building CXX object src/core/CMakeFiles/qgis_core.dir/moc_qgsopenclutils.cpp.o
In file included from src/qgis/build/src/core/../../../src/core/qgsopenclutils.h:34,
                 from src/qgis/build/src/core/moc_qgsopenclutils.cpp:9:
/usr/include/CL/cl2.hpp:446:124: note: #pragma message: cl2.hpp: CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120 or 200). It will be set to 200
 # pragma message("cl2.hpp: CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120 or 200). It will be set to 200")
                                                                                                                            ^
make[1]: *** [CMakeFiles/Makefile2:324: src/core/CMakeFiles/qgis_core.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Judging by the qgis exclusive results on CL_HPP_TARGET_OPENCL_VERSION + "220" I think this is a bug in QGIS.

https://www.google.com/search?q=CL_HPP_TARGET_OPENCL_VERSION+"220"
https://www.google.com/search?q="CL_HPP_TARGET_OPENCL_VERSION+220"

The value 220 is defined in src/core/qgsopenclutils.h

I have no idea what value this should have but it compiles fine for me with 200. I don't know how to test if OpenCL-enabled things work in QGIS afterwards.

build.log Magnifier (2.11 MB) Burak Arslan, 2019-03-12 12:08 AM

History

#1 Updated by Alessandro Pasotti almost 6 years ago

  • Status changed from Open to Feedback

Did you install the ICD ocl-icd-opencl-dev package ?

The 220/200 complaint message is not an error but a warning (that does not abort the compilation), the reason why I set it to 220 is that OpenCL 2.2 is already out, but if the header does not support 220 it will automatically set it to 200 and print the warning.

What is your operating system and version?

#2 Updated by Johannes Kroeger almost 6 years ago

I am on Archlinux with a nvidia card.

opencl-headers 2:2.2.20170516-2
opencl-nvidia 415.27-1

It compiles fine after I installed ocl-icd-2.2.12-3. Weirdly enough I still see the same warnings, it just does not fail now.

So is that ocl-icd thing a new dependency?

#3 Updated by Alessandro Pasotti almost 6 years ago

  • Status changed from Feedback to Rejected
  • Resolution set to invalid

Johannes Kroeger wrote:

I am on Archlinux with a nvidia card.

opencl-headers 2:2.2.20170516-2
opencl-nvidia 415.27-1

It compiles fine after I installed ocl-icd-2.2.12-3. Weirdly enough I still see the same warnings, it just does not fail now.

There is nothing wierd in the (harmless) warning, as I said I set it to 220 (version 2.2) to be ready when it will be finally available.

So is that ocl-icd thing a new dependency?

It is only if you want to build QGIS with OpenCL support, it is listed in https://github.com/qgis/QGIS/blob/master/INSTALL#L183

#4 Updated by Johannes Kroeger almost 6 years ago

Thank you!

#5 Updated by Alessandro Pasotti almost 6 years ago

Thank you for the feedback, OpenCL is relatively new stuff, let me know if you have problems working with that.

#6 Updated by Burak Arslan over 5 years ago

I'm on gentoo with nvidia-drivers-418.43. QGIS 3.6.0 doesn't build for me. the build log is attached.

#7 Updated by Alessandro Pasotti over 5 years ago

Looks like you did not install opencl headers. You need cl.h

/usr/include/CL/cl.h
/usr/include/CL/cl2.hpp

#8 Updated by Burak Arslan over 5 years ago

Looks like you did not look at the file I attached.

CL headers seem to be included in the qgis source distribution.

Here are the first few lines of the compilation error output from trying to compile src/core/raster/qgshillshaderenderer.cpp for your convenience:

In file included from /var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/src/core/qgsopenclutils.h:34:0,
                 from /var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/src/core/raster/qgshillshaderenderer.cpp:34:
/var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/external/opencl-clhpp/include/CL/cl2.hpp:446:124: note: #pragma message: cl2.hpp: CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120 or 200). It will be set to 200
 # pragma message("cl2.hpp: CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120 or 200). It will be set to 200")
                                                                                                                            ^
In file included from /var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/src/core/qgsopenclutils.h:34:0,
                 from /var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/src/core/raster/qgshillshaderenderer.cpp:34:
/var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/external/opencl-clhpp/include/CL/cl2.hpp:1323:1: error: ‘CL_DEVICE_QUEUE_ON_HOST_PROPERTIES’ was not declared in this scope
 CL_HPP_PARAM_NAME_INFO_2_0_(CL_HPP_DECLARE_PARAM_TRAITS_)
 ^

#9 Updated by Alessandro Pasotti over 5 years ago

Hmmm, I did indeed read your logs and I spent quite some time of my (volunteer) time to do that and try to be helpful.

What you miss is /usr/include/CL/cl.h which is NOT included in QGIS source tree.

Btw, this QGIS issue tracker is not an helpdesk for people that cannot build QGIS, please use the mailing lists for that.

Last but not least: you can safely ignore the warning: "CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120 or 200). It will be set to 200

#10 Updated by Burak Arslan over 5 years ago

The cl.h is not relevant here. I don't understand what makes you think that.

Maybe this is what tipped you off?

-- Found OpenCL: /usr/lib/libOpenCL.so (found version "1.2")
-- Couldn't find OpenCL C++ headers, using internal: /var/tmp/portage/sci-geosciences/qgis-3.6.0/work/qgis-3.6.0/external/opencl-clhpp/include

I do have cl.h in my test machine. I don't have cl.hpp, which is why you see that.

There aren't any compiler errors regarding a missing cl.h. So I don't believe a missing cl.h is the problem here. Unless you can prove otherwise? This looks like a code portability issue to me (compiles fine on another machine with intel gpu but not nvidia) that's why i'm here.

Also available in: Atom PDF