Getting started on GPU programming (opencl)

  • Thread starter Thread starter fluidistic
  • Start date Start date
  • Tags Tags
    Gpu Programming
Click For Summary

Discussion Overview

The discussion centers around getting started with GPU programming using OpenCL, specifically for an Intel integrated HD4000 graphics card. Participants explore the necessary tools, SDKs, and programming languages suitable for GPU computations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses a desire to learn how to write a simple GPU program using OpenCL to calculate 4*2.
  • Another participant inquires about the availability of the OpenCL SDK for the Intel HD4000 and suggests checking Intel's official resources for guidance.
  • A participant mentions the need for specific packages on Arch Linux, including intel-opencl-runtime, ocl-icd, and opencl-headers, to execute OpenCL code.
  • There is a suggestion regarding the use of Python with the python-pyopencl package, although one participant raises concerns about Python's performance and the challenges of using PyOpenCL as a wrapper for OpenCL.
  • Alternatives to Python are proposed, including C++ and libraries such as ArrayFire, Boost.Compute, and VexCL, which may offer better performance and usability for GPU programming.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the best programming language or approach for GPU programming, with differing opinions on the suitability of Python versus C++ and the associated libraries.

Contextual Notes

There are mentions of specific dependencies and packages required for OpenCL on Arch Linux, but the discussion does not resolve the effectiveness or performance of different programming languages or libraries.

fluidistic
Gold Member
Messages
3,934
Reaction score
286
I'd like to know how to get started to write a program for the GPU. Say I want to let the GPU calculate 4*2.
I have an intel integrated HD4000 graphics card so I'd be better to use opencl I believe.
I'm not really finding any tutorial on how to do this. Any help or comment is welcome.
 
Technology news on Phys.org
fluidistic said:
I'd like to know how to get started to write a program for the GPU. Say I want to let the GPU calculate 4*2.
I have an intel integrated HD4000 graphics card so I'd be better to use opencl I believe.
I'm not really finding any tutorial on how to do this. Any help or comment is welcome.
Do you have the opencl SDK for the Intel HD4000? If so, have you looked at the information in https://software.intel.com/en-us/intel-opencl ?

PS. I am not familiar with it, so I can't say for sure that the information there will answer your questions. But it may let you focus in on more specific issues.
 
  • Like
Likes   Reactions: fluidistic
FactChecker said:
Do you have the opencl SDK for the Intel HD4000? If so, have you looked at the information in https://software.intel.com/en-us/intel-opencl ?

PS. I am not familiar with it, so I can't say for sure that the information there will answer your questions. But it may let you focus in on more specific issues.
Thanks, I wasn't aware I'd need specific packages. I use arch linux so I'm reading https://wiki.archlinux.org/index.php/GPGPU.
Apparently I need the AUR package intel-opencl-runtime to execute code and [URL='https://www.archlinux.org/packages/?name=ocl-icd']ocl-icd, as well as [URL='https://www.archlinux.org/packages/?name=opencl-headers']opencl-headers.[/URL]
[URL='https://www.archlinux.org/packages/?name=ocl-icd']
I also see a Python language binding package called python-pyopencl.
Programming in python would be nice, to say the least.
 
  • Like
Likes   Reactions: FactChecker
fluidistic said:
I also see a Python language binding package called python-pyopencl.
Programming in python would be nice, to say the least.
Python is not the first thing I would think of in this context. Python is so slow, and PyOpenCL is a very thin wrapper on top of the very verbose and rather hard to use OpenCL framework. You'll get all of the pain of OpenCL and all of the slowness of Python.

If you're willing to work in C++ (or better, C++11), there are a lot of options. Three of them, in alphabetical order, are ArrayFire, Boost.Compute, and VexCL. I'm sure there are others.
 
  • Like
Likes   Reactions: fluidistic, QuantumQuest, jim mcnamara and 1 other person

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
4
Views
2K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
10
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K