clinfo | query OpenCL platform and device parameters | GPU library

 by   simleb C Version: v1.0 License: GPL-3.0

kandi X-RAY | clinfo Summary

kandi X-RAY | clinfo Summary

clinfo is a C library typically used in Hardware, GPU applications. clinfo has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has low support. You can download it from GitHub.

query OpenCL platform and device parameters
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              clinfo has a low active ecosystem.
              It has 23 star(s) with 13 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 1 open issues and 3 have been closed. On average issues are closed in 1 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of clinfo is v1.0

            kandi-Quality Quality

              clinfo has 0 bugs and 0 code smells.

            kandi-Security Security

              clinfo has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              clinfo code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              clinfo is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              clinfo releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of clinfo
            Get all kandi verified functions for this library.

            clinfo Key Features

            No Key Features are available at this moment for clinfo.

            clinfo Examples and Code Snippets

            clinfo,Build
            Cdot img1Lines of Code : 4dot img1License : Strong Copyleft (GPL-3.0)
            copy iconCopy
            make
            
            make install
            
            make uninstall
            
            make install prefix=$(HOME)
              

            Community Discussions

            QUESTION

            How to resolve the mismatch between OpenCl Library and OpenCl platform?
            Asked 2021-Nov-25 at 11:31

            Openvino inference crashes. I think the source of issue is the note at the end of clinfo command:

            ...

            ANSWER

            Answered 2021-Nov-25 at 11:31

            Try installing the latest Intel Compute Engine 21.45.21574 and see if it resolves the issue.

            Source https://stackoverflow.com/questions/69971216

            QUESTION

            N-body OpenCL code : error CL_​OUT_​OF_​HOST_​MEMORY with GPU card NVIDIA A6000
            Asked 2021-Oct-10 at 05:52

            I would like to make run an old N-body which uses OpenCL.

            I have 2 cards NVIDIA A6000 with NVLink, a component which binds from an hardware (and maybe software ?) point of view these 2 GPU cards.

            But at the execution, I get the following result:

            Here is the kernel code used (I have put pragma that I estimate useful for NVIDIA cards):

            ...

            ANSWER

            Answered 2021-Aug-07 at 12:36

            Your kernel code looks good and the cache tiling implementation is correct. Only make sure that the number of bodies is a multiple of local size, or alternatively limit the inner for loop to the global size additionally.

            OpenCL allows usage of multiple devices in parallel. You need to make a thread with a queue for each device separately. You also need to take care of device-device communications and synchronization manually. Data transfer happens over PCIe (you also can do remote direct memory access); but you can't use NVLink with OpenCL. This should not be an issue in your case though as you need only little data transfer compared to the amount of arithmetic.

            A few more remarks:

            • In many cases N-body requires FP64 to sum up the forces and resolve positions at very different length scales. However on the A6000, FP64 performance is very poor, just like on GeForce Ampere. FP32 would be significantly (~64x) faster, but is likely insufficient in terms of accuracy here. For efficient FP64 you would need an A100 or MI100.
            • Instead of 1.0/sqrt, use rsqrt. This is hardware supported and almost as fast as a multiplication.
            • Make sure to use either FP32 float (1.0f) or FP64 double (1.0) literals consistently. Using double literals with float triggers double arithmetic and casting of the result back to float which is much slower.

            EDIT: To help you out with the error message: Most probably the error at clCreateKernel (what value does status have after calling clCreateKernel?) hints that program is invalid. This might be because you give clBuildProgram a vector of 2 devices, but set the number of devices to only 1 and also have context only for 1 device. Try

            Source https://stackoverflow.com/questions/68548139

            QUESTION

            OpenCL non-diverging if() followed by printf() causing massive slowdown and kernel code interfering on maximum workgroup size
            Asked 2021-Aug-18 at 18:13

            I am new to OpenCL and I have read in several places that if/else structures should be avoided, mainly because when the evaluation of threads is different (divergent branching) there is a significant slowdown.

            Nonetheless, I used one if(cond) followed by some prints to guarantee that when a forbidden condition is met I can debug what caused it. The point is, whenever the if() is true for a single thread I will kill the process, therefore I am not worried about different threads evaluating the condition differently.

            Yet, I found out that even when all threads evaluate false in this if(), there is a massive slowdown when compared to not using the if() -- I commented out the conditional and its body statements to verify.

            An observation: I have a kernel (128 workgroups, each one with 128 workitems) that calls a function foo(), and the if/prints are inside foo(). The relevant part of foo() is as follows:

            ...

            ANSWER

            Answered 2021-Aug-14 at 09:24

            it seems that you got a problem with the debug. Iknow that using ARM mali you need to add in you CCP

            Source https://stackoverflow.com/questions/68744614

            QUESTION

            undefined reference to `clCreateCommandQueueWithProperties' despite ocl-icd-opencl-dev is installed
            Asked 2021-Aug-13 at 05:25

            During compilation, I am compiling a large program. One compilation step gives me the following error:

            clang++ -o selfdrive/camerad/camerad -Wl,--as-needed -Wl,-rpath=/home/ziyuan/openpilot/phonelibs/snpe/x86_64-linux-clang -Wl,-rpath=/home/ziyuan/openpilot/cereal -Wl,-rpath=/home/ziyuan/openpilot/selfdrive/common selfdrive/camerad/main.o selfdrive/camerad/cameras/camera_common.o selfdrive/camerad/transforms/rgb_to_yuv.o selfdrive/camerad/imgproc/utils.o selfdrive/camerad/cameras/camera_frame_stream.o -Lphonelibs/snpe/x86_64-linux-clang -Lphonelibs/libyuv/x64/lib -Lphonelibs/mapbox-gl-native-qt/x86_64 -Lcereal -Lselfdrive/common -L/usr/lib -L/usr/local/lib -Lcereal -Lphonelibs -Lopendbc/can -Lselfdrive/boardd -Lselfdrive/common -lm -lpthread selfdrive/common/libcommon.a -ljson11 -ljpeg -lOpenCL cereal/libcereal.a cereal/libmessaging.a -lzmq -lcapnp -lkj cereal/libvisionipc.a selfdrive/common/libgpucommon.a -lGL

            /usr/bin/ld: selfdrive/camerad/cameras/camera_common.o: in function CameraBuf::init(_cl_device_id*, _cl_context*, CameraState*, VisionIpcServer*, int, VisionStreamType, VisionStreamType, void (*)(void*, int))': /home/ziyuan/openpilot/selfdrive/camerad/cameras/camera_common.cc:92: undefined reference to clCreateCommandQueueWithProperties'

            When I check the linker, I got the following:

            ...

            ANSWER

            Answered 2021-Aug-13 at 05:25

            As also answered here, clCreateCommandQueueWithProperties is an OpenCL 2.0 thing. Nvidia GPUs only support OpenCL 1.2. Nvidia recently "upgraded" to OpenCL version 3.0, but this is just a new name for version 1.2. OpenCL 2.0 features are still not supported.

            Source https://stackoverflow.com/questions/68762588

            QUESTION

            OpenCL and OpenGL interop extension not working (clGetGLContextInfoKHR crash)
            Asked 2021-Jul-13 at 15:43

            I'm struggling with getting GL+CL to work together.

            I've been following this tutorial. In my code I first call clGetPlatformIDs and retrieve the first (and only) platform. I also get my gl_context from SDL2. Then I want to query the device used by OpenGL with help of clGetGLContextInfoKHR. I successfully obtain this function with clGetExtensionFunctionAddressForPlatform(platform_id, "clGetGLContextInfoKHR") but unfortunately when I call it, I get a segmentation fault. My code is written in Rust but I use low level OpenCL binding, so it looks almost like its C counterpart.

            ...

            ANSWER

            Answered 2021-Jul-13 at 15:43

            I am not sure why clGetGLContextInfoKHR is failing but I figured out that it's not really necesary to call it.

            Instead you may just use this on Linux

            Source https://stackoverflow.com/questions/68325230

            QUESTION

            NVIDIA OpenCL Device Version
            Asked 2021-May-03 at 16:20

            NVIDIA has recently announced OpenCL 3.0 support for their graphics cards. I have NVIDIA Geforce MX150 card and I have updated my CUDA toolkit to version 11.3 with 465.19.01 driver. I have installed clinfo tool that displays all information regarding OpenCL platforms and devices. When I run it, it dislpays:

            • Device Version = OpenCL 3.0 CUDA
            • Driver Version = 465.19.01
            • Device OpenCL C Version = OpenCL C 1.2

            I am a bit confused here. What is the difference between Device version & Device OpenCL C version? Will I be able to run OpenCL 3.0 code on my card or it just still support OpenCL 1.2 specs?

            ...

            ANSWER

            Answered 2021-May-03 at 16:20

            According to the clGetDeviceInfo specification:

            CL_DEVICE_OPENCL_C_VERSION is the highest OpenCL C language version that the compiler supports for this device.

            CL_DEVICE_VERSION is the OpenCL version supported by the device.

            So even though your MX150 supports OpenCL 3.0, you can only compile OpenCL 1.2 code. Note that OpenCL 3.0 basically is identical to OpenCL 1.2 but with better support for optional OpenCL 2.x features. With the lates driver Nvidia has added a few new OpenCL 2.x features, but still has no full 2.x support.

            Source https://stackoverflow.com/questions/67371938

            QUESTION

            Do 64bit atomic operations work in openCL on AMD cards?
            Asked 2021-Apr-22 at 11:41

            The implementation of emulated atomics in openCL following the STREAM blog works nicely for atomic add in 32bit, on CPU as well as NVIDIA and AMD GPUs.

            The 64bit equivalent based on the cl_khr_int64_base_atomics extension seems to run properly on (pocl and intel) CPU as well as NVIDIA openCL drivers.

            I fail to make 64bit work on AMD GPU cards though -- both on amdgpu-pro and rocm (3.5.0) environments, running on a Radeon VII and a Radeon Instinct MI50, respectively.

            The implementation goes as follows:

            ...

            ANSWER

            Answered 2021-Apr-22 at 11:41

            For 64-bit, the function is called atom_cmpxchg and not atomic_cmpxchg.

            Source https://stackoverflow.com/questions/67211566

            QUESTION

            OpenCL: Invalid write of size # at global memory address 0x###
            Asked 2021-Feb-21 at 04:07

            Post-solution edit: The issue is with the code alone. There is no hardware issue here. Now to the original post:

            I'm trying to get a basic OpenCL program to work.

            The program simply creates a buffer, writes 42 to the buffer, reads it, and outputs.

            Here's the code, written in C:

            ...

            ANSWER

            Answered 2021-Feb-21 at 04:07

            I am a buffoon. The error was on the line I went to set the kernel argument:

            Source https://stackoverflow.com/questions/66289287

            QUESTION

            Using OpenCV with OpenCL on Intel UHD Graphics 630 along with nvidia GPU
            Asked 2020-Oct-28 at 22:38

            I currently have a program running all the time using my Nvidia GPU. I would like to run another one aside, which would use OpenCV with OpenCL. I use Ubuntu 18.04 and my processor is an Intel i7-9750H (with UHD Graphics 630).

            I run this C++ code to detect the available devices:

            ...

            ANSWER

            Answered 2020-Oct-28 at 22:38

            This is a somewhat messy situation. There is a difference between using multiple OpenCL devices from a single platform and different platforms.

            Question 2: Each OpenCL implementation/SDK/Runtime you install will show up as a platform. The context class of OpenCV is bound to a single platform and can only work with the corresponding devices. The constructor only allows to specify a device type, so it probably queries OpenCL and uses the first platform with that device type (or just the first). That's why OpenCV only shows the Nvidia device.

            Question 1: Creating another context reflecting the Intel platform would be possible by using the OpenCL API directly and then calling OpenCV's fromHandle() or fromDevice() functions to create the OpenCV Context object (the clinfo source is an example for the required code). But, using different platforms means linking to different OpenCL libraries (indirectly at runtime through the compile-time linked libOpenCL). I.e. memory objects, etc. cannot be shared between the different contexts, so practical usability is rather limited unless you have independent problems that you'd like to compute in parallel on both devices.

            Bonus: Your clinfo output shows 3 platforms (Nvidia OpenCL 1.2, Intel GPU OpenCL 3.0, Intel CPU OpenCL 2.1), and you see the warning:

            Source https://stackoverflow.com/questions/64446808

            QUESTION

            LWJGL finding different OpenCL installation when runing outside of IDE
            Asked 2020-Oct-20 at 19:36

            I've been using java in IntelliJ as a hobby for quite some time and have decided to start using OpenCL for parallel computing. I'm pretty sure that I've made no mistake downloading and adding the LWJGL library to my project, since it does always compile. The problem is that when I run the program, it produces this output:

            ...

            ANSWER

            Answered 2020-Oct-20 at 19:32

            While I did not find the exact problem, I solved it by reinstalling IntelliJ from their website. It seems that my previous installation done by the Linux Mint Software Manager was faulty. Everything is showing up fine now Thanks for reading and helping though

            Source https://stackoverflow.com/questions/64434070

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install clinfo

            clinfo is made from a single C source file. To build:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/simleb/clinfo.git

          • CLI

            gh repo clone simleb/clinfo

          • sshUrl

            git@github.com:simleb/clinfo.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular GPU Libraries

            taichi

            by taichi-dev

            gpu.js

            by gpujs

            hashcat

            by hashcat

            cupy

            by cupy

            EASTL

            by electronicarts

            Try Top Libraries by simleb

            FishFlow

            by simlebC++

            bindata

            by simlebGo

            pbsc

            by simlebRuby

            calc

            by simlebGo

            demofrustum

            by simlebC++