Comments on: Adventures in OpenCL: Part 1, Getting Started http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/?utm_source=rss&utm_medium=rss&utm_campaign=adventures-in-opencl-part-1-getting-started casin' the joint since '85 Wed, 09 May 2012 06:22:44 +0000 hourly 1 http://wordpress.org/?v=3.3.2 By: Nicholas Cain http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-1609 Nicholas Cain Thu, 12 Jan 2012 04:44:53 +0000 http://enja.org/?p=218#comment-1609 Thanks Ian! Worked right out of the box, great job! I am learning it all as fast as I can! -n Thanks Ian!

Worked right out of the box, great job!

I am learning it all as fast as I can!

-n

]]>
By: Harini http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-1607 Harini Wed, 11 Jan 2012 05:46:14 +0000 http://enja.org/?p=218#comment-1607 hey , can u please help me out. am a student , and very new to openCL. my pc is having AMD processor with ATI graphic card , i have installed visual studio 10 and AMD APP KernelAnalyzer 1.9 , n included 10 header files given in kronous group into my include folder of vc. i am noting getting next steps to compile it , please tell me how should i debug, build ,compile n run my example programs. im using windows vista os. pls do reply need help badly hey ,
can u please help me out. am a student , and very new to openCL. my pc is having AMD processor with ATI graphic card , i have installed visual studio 10 and AMD APP KernelAnalyzer 1.9 , n included 10 header files given in kronous group into my include folder of vc. i am noting getting next steps to compile it , please tell me how should i debug, build ,compile n run my example programs. im using windows vista os. pls do reply need help badly

]]>
By: tester http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-1094 tester Fri, 30 Sep 2011 03:06:30 +0000 http://enja.org/?p=218#comment-1094 Help needed Just downloaded the example onto ubuntu system 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC 2011 x86_64 GNU/Linux NVIDIA Quadro FX 3800 Intel(R) Xeon(R) CPU gcc version 4.4.3 Inside adventures_in_opencl/part1/build/ , after cmake .. make I get ./part1.x Hello, OpenCL Initialize OpenCL object and context Error -1001 in clGetPlatformIDs Call !!! oclGetPlatformID: clGetDeviceIDs (get number of devices): CL_INVALID_PLATFORM clGetDeviceIDs (create device list): CL_INVALID_PLATFORM load the program path: /home/dbanks/www-home/src/adventures_in_opencl/part1/part1.cl clCreateProgramWithSource: CL_INVALID_CONTEXT building the program clBuildProgram: CL_INVALID_PROGRAM BUILD LOG: ?program built in popCorn clCreateKernel: CL_INVALID_PROGRAM Creating OpenCL arrays Pushing data to the GPU zsh: segmentation fault ./part1.x Help needed

Just downloaded the example onto ubuntu system

2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC 2011 x86_64 GNU/Linux
NVIDIA Quadro FX 3800
Intel(R) Xeon(R) CPU
gcc version 4.4.3

Inside adventures_in_opencl/part1/build/ , after
cmake ..
make

I get
./part1.x
Hello, OpenCL
Initialize OpenCL object and context
Error -1001 in clGetPlatformIDs Call !!!

oclGetPlatformID:
clGetDeviceIDs (get number of devices): CL_INVALID_PLATFORM
clGetDeviceIDs (create device list): CL_INVALID_PLATFORM
load the program
path: /home/dbanks/www-home/src/adventures_in_opencl/part1/part1.cl
clCreateProgramWithSource: CL_INVALID_CONTEXT
building the program
clBuildProgram: CL_INVALID_PROGRAM
BUILD LOG:
?program built
in popCorn
clCreateKernel: CL_INVALID_PROGRAM
Creating OpenCL arrays
Pushing data to the GPU
zsh: segmentation fault ./part1.x

]]>
By: John http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-1037 John Fri, 12 Aug 2011 19:33:49 +0000 http://enja.org/?p=218#comment-1037 Thanks for the introduction. Part 1 works well on my windows system, with one minor change, as noted by Iarei you cannot use variable array sizes in MS Visual C. This is a C99 feature that MSVC does not implement. Replace these lines : float c_done[num]; err = clEnqueueReadBuffer(command_queue, cl_c, CL_TRUE, 0, sizeof(float) * num, &c_done, 0, NULL, &event); with these std::vector c_done(num); err = clEnqueueReadBuffer(command_queue, cl_c, CL_TRUE, 0, sizeof(float) * num, &(c_done[0]), 0, NULL, &event); and add #include [Ugly but it works] I'm using Visual studio 2010, with CUDA 4.0. The -g compile flag is also not available - but only generates a compile time warning. You could consider wrapping it in IF(NOT MSVC). Thanks for the introduction. Part 1 works well on my windows system, with one minor change, as noted by Iarei you cannot use variable array sizes in MS Visual C. This is a C99 feature that MSVC does not implement. Replace these lines :
float c_done[num];
err = clEnqueueReadBuffer(command_queue, cl_c, CL_TRUE, 0, sizeof(float) *
num, &c_done, 0, NULL, &event);
with these
std::vector c_done(num);
err = clEnqueueReadBuffer(command_queue, cl_c, CL_TRUE, 0, sizeof(float) *
num, &(c_done[0]), 0, NULL, &event);
and add #include
[Ugly but it works]
I’m using Visual studio 2010, with CUDA 4.0.
The -g compile flag is also not available – but only generates a compile time warning. You could consider wrapping it in IF(NOT MSVC).

]]>
By: Ben http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-957 Ben Wed, 13 Jul 2011 23:36:40 +0000 http://enja.org/?p=218#comment-957 It is not working on my system, and I don't know why. Can anyone help me please? This is the output I have seen. build$ ./part1.x Hello, OpenCL Initialize OpenCL object and context Available platforms: platform 0: ATI Stream selected platform: 0 oclGetPlatformID: CL_SUCCESS clGetDeviceIDs (get number of devices): CL_DEVICE_NOT_FOUND clGetDeviceIDs (create device list): CL_INVALID_VALUE load the program path: /home/benjamin/workspace/enjalot-adventures_in_opencl-a5bb2a1/part1/part1.cl clCreateProgramWithSource: CL_INVALID_CONTEXT building the program clBuildProgram: CL_INVALID_PROGRAM BUILD LOG: program built in popCorn clCreateKernel: CL_INVALID_PROGRAM Creating OpenCL arrays Pushing data to the GPU Segmentation fault It is not working on my system, and I don’t know why. Can anyone help me please?
This is the output I have seen.

build$ ./part1.x
Hello, OpenCL
Initialize OpenCL object and context
Available platforms:
platform 0: ATI Stream
selected platform: 0
oclGetPlatformID: CL_SUCCESS
clGetDeviceIDs (get number of devices): CL_DEVICE_NOT_FOUND
clGetDeviceIDs (create device list): CL_INVALID_VALUE
load the program
path: /home/benjamin/workspace/enjalot-adventures_in_opencl-a5bb2a1/part1/part1.cl
clCreateProgramWithSource: CL_INVALID_CONTEXT
building the program
clBuildProgram: CL_INVALID_PROGRAM
BUILD LOG:
program built
in popCorn
clCreateKernel: CL_INVALID_PROGRAM
Creating OpenCL arrays
Pushing data to the GPU
Segmentation fault

]]>
By: Intel’s OpenCL (Linux How-To) | http://litaos.com/ http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-860 Intel’s OpenCL (Linux How-To) | http://litaos.com/ Thu, 12 May 2011 01:58:25 +0000 http://enja.org/?p=218#comment-860 [...] http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/ This link will take you to the first tutorials I found that actually have a full OpenCL Coded download and Word Press blog explaining what is actually happening in the code (All for Linux, by the way!) [...] [...] http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/ This link will take you to the first tutorials I found that actually have a full OpenCL Coded download and Word Press blog explaining what is actually happening in the code (All for Linux, by the way!) [...]

]]>
By: Krish http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-747 Krish Wed, 30 Mar 2011 06:23:30 +0000 http://enja.org/?p=218#comment-747 Hi i just started learning openCL my m/c is HP Z600 Workstation with Nvidia Quadro FX 3800 i have installed nvida drivers & cuda computing sdk..... & all environmental vars. set....... OS: Fedora14 _ 64 Bit gcc: 4.5.2 but wen i am compiling opencl progs it gives me error CL/cl_platform.h : No such file or directory .... pls guide me on how to rectify this........... Hi
i just started learning openCL
my m/c is HP Z600 Workstation with Nvidia Quadro FX 3800
i have installed nvida drivers & cuda computing sdk…..
& all environmental vars. set…….
OS: Fedora14 _ 64 Bit gcc: 4.5.2
but wen i am compiling opencl progs it gives me error
CL/cl_platform.h : No such file or directory ….

pls guide me on how to rectify this………..

]]>
By: Adventures in PyOpenCL: Part 1 Getting Started with Python | enj http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-648 Adventures in PyOpenCL: Part 1 Getting Started with Python | enj Wed, 23 Feb 2011 03:09:01 +0000 http://enja.org/?p=218#comment-648 [...] and I’ve recently started playing with a great module called PyOpenCL. I’ve ported my Part 1 (and Part 1.5) tutorials from C (and C++) to Python using PyOpenCL and things are way simpler as [...] [...] and I’ve recently started playing with a great module called PyOpenCL. I’ve ported my Part 1 (and Part 1.5) tutorials from C (and C++) to Python using PyOpenCL and things are way simpler as [...]

]]>
By: Iarei http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-619 Iarei Tue, 08 Feb 2011 03:07:54 +0000 http://enja.org/?p=218#comment-619 @Jack: I'm about where you are in figuring this out. According to what I'm reading - " Statically allocated arrays need to have a known length at compile-time. " GCC apparently has some inherent way of handling this that VS lacks. So I guess you need to define NUM as a vector? It's probably better if someone who knows what their talking about explains this. @Jack: I’m about where you are in figuring this out. According to what I’m reading -
” Statically allocated arrays need to have a known length at compile-time. ” GCC apparently has some inherent way of handling this that VS lacks. So I guess you need to define NUM as a vector? It’s probably better if someone who knows what their talking about explains this.

]]>
By: Jack http://enja.org/2010/07/13/adventures-in-opencl-part-1-getting-started/comment-page-1/#comment-616 Jack Fri, 04 Feb 2011 01:34:59 +0000 http://enja.org/?p=218#comment-616 Yesterday I had success with the Mac mini running Snow Leopard and a NVIDIA GeForce 320M. Today I am testing it on Windows 7 64-bit with an ATI Radeon HD 5700 Series. I have installed ati-stream-sdk-v2.3-vista-win7-64.exe Visual Studio C++ 2008 Express Edition, I compiled the sample code OpenCLSamples.sln All but SimpleDX10 compiled, I tested several of the sample opencl programs Now I am experiencing some difficulty trying Adventures in OpenCL: Part 1, Getting Started in this environment and I know I have not tried everything yet. I tried the cmake GUI native compiler visual studio 9 2008. I put the source and build as parent and child directories just as the terminal example on the mac. CMake module path: C:/Users/jshultz/Documents/Visual Studio 2008/Projects/adventures_in_opencl.git/part1/../cmake include directories: C:/Users/jshultz/Documents/Visual Studio 2008/Projects/adventures_in_opencl.git/part1/../opencl10 Configuring done WARNING: Target "part1.x" requests linking to directory "C:\Users\jshultz\Documents\ATI Stream\lib\x86_64". Targets may link only to libraries. CMake is dropping the item. WARNING: Target "part1.x" requests linking to directory "C:\Users\jshultz\Documents\ATI Stream\lib\x86_64". Targets may link only to libraries. CMake is dropping the item. WARNING: Target "part1.x" requests linking to directory "C:\Users\jshultz\Documents\ATI Stream\lib\x86_64". Targets may link only to libraries. CMake is dropping the item. WARNING: Target "part1.x" requests linking to directory "C:\Users\jshultz\Documents\ATI Stream\lib\x86_64". Targets may link only to libraries. CMake is dropping the item. Generating done Build solution file in VS C++ 1>------ Build started: Project: part1, Configuration: Release Win32 ------ 1>Compiling... 1>cl : Command line warning D9002 : ignoring unknown option '-g' 1>cll.cpp 1>util.cpp 1>..\util.cpp(13) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of 'fopen' 1>part1.cpp 1>..\part1.cpp(69) : error C2057: expected constant expression 1>..\part1.cpp(69) : error C2466: cannot allocate an array of constant size 0 1>..\part1.cpp(69) : error C2133: 'c_done' : unknown size 1>Generating Code... 1>Build log was saved at "file://c:\Users\jshultz\Documents\Visual Studio 2008\Projects\adventures_in_opencl.git\part1\build\part1.dir\Release\BuildLog.htm" 1>part1 - 3 error(s), 2 warning(s) 2>------ Build started: Project: part1.x, Configuration: Release Win32 ------ 2>Compiling... 2>cl : Command line warning D9002 : ignoring unknown option '-g' 2>main.cpp 2>Linking... 2>LINK : fatal error LNK1181: cannot open input file 'Release\part1.lib' 2>Build log was saved at "file://c:\Users\jshultz\Documents\Visual Studio 2008\Projects\adventures_in_opencl.git\part1\build\part1.x.dir\Release\BuildLog.htm" 2>part1.x - 1 error(s), 1 warning(s) 3>------ Skipped Build: Project: ALL_BUILD, Configuration: Release Win32 ------ 3>Project not selected to build for this solution configuration ========== Build: 0 succeeded, 2 failed, 1 up-to-date, 1 skipped ========== Yesterday I had success with the Mac mini running Snow Leopard and a NVIDIA GeForce 320M.

Today I am testing it on Windows 7 64-bit with an ATI Radeon HD 5700 Series. I have installed ati-stream-sdk-v2.3-vista-win7-64.exe
Visual Studio C++ 2008 Express Edition, I compiled the sample code OpenCLSamples.sln
All but SimpleDX10 compiled, I tested several of the sample opencl programs

Now I am experiencing some difficulty trying Adventures in OpenCL: Part 1, Getting Started in this environment and I know I have not tried everything yet. I tried the cmake GUI native compiler visual studio 9 2008. I put the source and build as parent and child directories just as the terminal example on the mac.
CMake module path: C:/Users/jshultz/Documents/Visual Studio 2008/Projects/adventures_in_opencl.git/part1/../cmake

include directories:

C:/Users/jshultz/Documents/Visual Studio 2008/Projects/adventures_in_opencl.git/part1/../opencl10

Configuring done
WARNING: Target “part1.x” requests linking to directory “C:\Users\jshultz\Documents\ATI Stream\lib\x86_64″. Targets may link only to libraries. CMake is dropping the item.
WARNING: Target “part1.x” requests linking to directory “C:\Users\jshultz\Documents\ATI Stream\lib\x86_64″. Targets may link only to libraries. CMake is dropping the item.
WARNING: Target “part1.x” requests linking to directory “C:\Users\jshultz\Documents\ATI Stream\lib\x86_64″. Targets may link only to libraries. CMake is dropping the item.
WARNING: Target “part1.x” requests linking to directory “C:\Users\jshultz\Documents\ATI Stream\lib\x86_64″. Targets may link only to libraries. CMake is dropping the item.
Generating done

Build solution file in VS C++
1>—— Build started: Project: part1, Configuration: Release Win32 ——
1>Compiling…
1>cl : Command line warning D9002 : ignoring unknown option ‘-g’
1>cll.cpp
1>util.cpp
1>..\util.cpp(13) : warning C4996: ‘fopen’: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(237) : see declaration of ‘fopen’
1>part1.cpp
1>..\part1.cpp(69) : error C2057: expected constant expression
1>..\part1.cpp(69) : error C2466: cannot allocate an array of constant size 0
1>..\part1.cpp(69) : error C2133: ‘c_done’ : unknown size
1>Generating Code…
1>Build log was saved at “file://c:\Users\jshultz\Documents\Visual Studio 2008\Projects\adventures_in_opencl.git\part1\build\part1.dir\Release\BuildLog.htm”
1>part1 – 3 error(s), 2 warning(s)
2>—— Build started: Project: part1.x, Configuration: Release Win32 ——
2>Compiling…
2>cl : Command line warning D9002 : ignoring unknown option ‘-g’
2>main.cpp
2>Linking…
2>LINK : fatal error LNK1181: cannot open input file ‘Release\part1.lib’
2>Build log was saved at “file://c:\Users\jshultz\Documents\Visual Studio 2008\Projects\adventures_in_opencl.git\part1\build\part1.x.dir\Release\BuildLog.htm”
2>part1.x – 1 error(s), 1 warning(s)
3>—— Skipped Build: Project: ALL_BUILD, Configuration: Release Win32 ——
3>Project not selected to build for this solution configuration
========== Build: 0 succeeded, 2 failed, 1 up-to-date, 1 skipped ==========

]]>