hello everybody,
as a completely newcomer to OpenCl and such, i wanted to try to run some samples before getting into source. So basically, here is the result of the execution of the helloworld sample from the samples we get when we have extracted the auto installer :
the execution of the helloworld sample |
---|
input string: GdkknVnqkc output string: `�B Passed! |
In fact, i get completely random characters as output.
However, i think my installation is correct :
here is my os (command uname + cat /etc/os-release):
Linux x86_64 GNU/Linux | openSUSE 13.1 | kernel: 3.11.10-29-desktop
here is the result of clinfo command (sorry i did not find anything to include a personnal txt file)
clinfo command | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Minimum alignment (bytes) for any datatype: 128 Single precision floating point capability
Max global variable preferred total size: 16978542592
Kernel Preferred work group size multiple: 64
Minimum alignment (bytes) for any datatype: 128 Single precision floating point capability
Max global variable preferred total size: 1879048192
Kernel Preferred work group size multiple: 1
|
Any idea from what it could come?
thanks in advance,
Solved! Go to Solution.
so basically, when i runned some more complete samples with COMPUTE=:0 i found that the computation switched direclty to CPU instead of GPU, as GPU was not visibly recognized correctly.
i so uninstalled the previous driver (which was got using fglrx package) with the --force option to make a clean reinstall of it using the latest version possible direclty downloaded from amd website. And now, everything works, headless or not.
thanks for your answers, your fastness and your help.
see you again if i get any more problem
After the successful run, the "HelloWorld" sample should print "output string" as "HelloWorld". In the corresponding "helloworld" kernel code [file "HelloWorld_Kernel.cl" in same directory as the binary], it just adds 1 to each input character value.
I'm not sure why you are getting the garbage string. However, as I guess, if the kernel fails to execute, the output buffer may contain garbage values and thus may print garbage output string. You know, its one of the earliest samples and trivial one, so, it lacks few error checking and messages. In the <APP SDK>/samples/opencl/cl/HelloWorld sample, you may check return status of the APIs to verify whether everything working fine or not. For example, you may check the value of the "status" for the below line. A non-zero value indicates an error.
status = clEnqueueNDRangeKernel(commandQueue, kernel, 1, NULL, global_work_size, NULL, 0, NULL, NULL);
BTW, did you try other samples? Are they working fine?
If haven't tried yet, please run some other samples and see.
Regards,
Hello,
so I tried what you said and here are the results:
in the HelloWorld exemple, the said function " clEnqueueNDRangeKernel" returns a "CL_INVALID_COMMAND_QUEUE"; which seems to come from the "clCreateCommandQueue" function (and here i haven't figured how to get correctly the error code, but it's certainly CL_OUT_OF_HOST_MEMORY).
In fact, when i try to run other samples, the results vary: most of the time i get an error about CL_OUT_OF_HOST_MEMORY (for Extractprime, stringsearch, simpleimage for example), or even a segmentation fault on bigger programs like gaussianNoise, but template program works fine.
i will try to take a look at kernel configuration.
FYI:
You can know the error code of APIs like clCreateCommandQueue, clCreateProgramWithSource etc. which return error code via last function argument as follows:
cl_int errorCode;
clCreateCommandQueue(..., &errorCode);
std::cout << " Error code = " << errorCode;
Regards,
Hello everybody,
thanks for the code snippet.
so in Helloworld exemple, the error is correclty CL_OUT_OF_HOST_MEMORY.
By the way, i got the program running if i put "COMPUTE=:0", then it may be a problem with the fact i run it from ssh : https://community.amd.com/thread/158710
I will read everything about it and get you what i'll do.
so basically, when i runned some more complete samples with COMPUTE=:0 i found that the computation switched direclty to CPU instead of GPU, as GPU was not visibly recognized correctly.
i so uninstalled the previous driver (which was got using fglrx package) with the --force option to make a clean reinstall of it using the latest version possible direclty downloaded from amd website. And now, everything works, headless or not.
thanks for your answers, your fastness and your help.
see you again if i get any more problem
Its nice to hear that everything is working fine now. You've really solved it quickly. Smart observations.
Regards,