cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ealbayrak
Journeyman III

Need Help "Error code : CL_DEVICE_NOT_FOUND"

Samples doesn't work on GPU but CPU is fine

Hello i'm kind of a noob in OpenCL and Linux, i've just started using OpenCL and still trying to setup necessary parts, drivers etc. to my Computer.

My problem is when I try to run the samples they give the following error "Error: clCreateContextFromType failed. Error code : CL_DEVICE_NOT_FOUND"

I've downloaded the driver that the one is suggested by "Hardware Drivers" application in Ubuntu.

I think i've managed to compile the samples, and my CLInfo gives the following result,

 

Number of platforms: 1

  Platform Profile: FULL_PROFILE

  Platform Version: OpenCL 1.1 ATI-Stream-v2.2 (302)

  Platform Name: ATI Stream

  Platform Vendor: Advanced Micro Devices, Inc.

  Platform Extensions: cl_khr_icd cl_amd_event_callback

 

 

  Platform Name: ATI Stream

Number of devices: 1

  Device Type: CL_DEVICE_TYPE_CPU

  Device ID: 4098

  Max compute units: 2

  Max work items dimensions: 3

    Max work items[0]: 1024

    Max work items[1]: 1024

    Max work items[2]: 1024

  Max work group size: 1024

  Preferred vector width char: 16

  Preferred vector width short: 8

  Preferred vector width int: 4

  Preferred vector width long: 2

  Preferred vector width float: 4

  Preferred vector width double: 0

  Max clock frequency: 2534Mhz

  Address bits: 32

  Max memory allocation: 536870912

  Image support: No

  Max size of kernel argument: 4096

  Alignment (bits) of base address: 1024

  Minimum alignment (bytes) for any datatype: 128

  Single precision floating point capability

    Denorms: Yes

    Quiet NaNs: Yes

    Round to nearest even: Yes

    Round to zero: Yes

    Round to +ve and infinity: Yes

    IEEE754-2008 fused multiply-add: No

  Cache type: Read/Write

  Cache line size: 64

  Cache size: 32768

  Global memory size: 1073741824

  Constant buffer size: 65536

  Max number of constant args: 8

  Local memory type: Global

  Local memory size: 32768

  Profiling timer resolution: 1

  Device endianess: Little

  Available: Yes

  Compiler available: Yes

  Execution capabilities:  

    Execute OpenCL kernels: Yes

    Execute native function: Yes

  Queue properties:  

    Out-of-Order: No

    Profiling : Yes

  Platform ID: 0x1b65dc0

  Name: Intel(R) Core(TM)2 Duo CPU     P8700  @ 2.53GHz

  Vendor: GenuineIntel

  Driver version: 2.0

  Profile: FULL_PROFILE

  Version: OpenCL 1.1 ATI-Stream-v2.2 (302)

  Extensions: cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_printf 

Passed!



But it doesn't see my GPU as a device, what do I need to do? Do I have to activate it somehow or maybe I've failed to Install the latest driver?
By the way my GPU is Mobility Radeon HD 4650, on the website of OpenCL SDK this device is in the list of Beta Support. 
Finally my lspci|grep ATI is
01:00.0 VGA compatible controller: ATI Technologies Inc M96 [Mobility Radeon HD 4650]
01:00.1 Audio device: ATI Technologies Inc RV710/730
Thank you.
0 Likes
14 Replies
himanshu_gautam
Grandmaster

ealbayrak,

Here are a few suggestions:

1. Restart your computer after installation of the driver.

2.Try to run the samples with --device cpu option.If samples run this will ensure your SDK is working correctly.

3.Which Driver did you install.

4.Are you able to run CAL Samples?

0 Likes
ealbayrak
Journeyman III

First of all, my installed driver is 8.723.1-100408a-098580C-ATI

and yes OpenCL samples works fine with --device cpu parameter 

Most of the CAL samples gave some successful outputs, for example 

lds_transpose:

 

Supported CAL Runtime Version: 1.3.185

Found CAL Runtime Version: 1.4.635

Use -? for help

Program:                ./lds_transpose Kernel System

 WxH In-Out Src Dst Iter GB/sec GB/sec

 256x 256 1  1 4 4 2 6.47 0.83

 

Press enter to exit...

or 
loop_IL:
Supported CAL Runtime Version: 1.3.185
Found CAL Runtime Version: 1.4.635
Use -? for help
Program:                      ./loop_IL Kernel System
 WxH In-Out Src Dst Iter GB/sec GB/sec
 256x 256 0  1 4 4 2 3.32 0.74
however,
DoublePrecision:
Supported CAL Runtime Version: 1.3.185
Found CAL Runtime Version: 1.4.635
Use -? for help
The Device Number is invalid or this device is not capable of running this sample.
Gave this.
Maybe some of the CAL samples can work on CPU if they can't get GPU as default device?

 

0 Likes

Ealbayrak,

It looks your Catalyst driver is not installed properly.Did you do express installation or custom installation?

Try doing a fresh installation.Use Driver sweeper before installing driver again.

How many devices does the findnumdevices sample (CAL) show.Is your GPU visible from catalyst Control center and device manager.

 

There would be some samples which will not run on your GPU involvig Image support and double precision as these features are not available on this model.

0 Likes

FindNumDevices:

 

Supported CAL Runtime Version: 1.3.185

Found CAL Runtime Version: 1.4.635

Use -? for help

CAL initialized.

Finding out number of devices :- 

Device Count = 1

CAL shutdown successful.

and I didn't select anything, I simply let Ubuntu to download and activate the driver.
And yes ccc sees the GPU


0 Likes

ealbayrak,

IT seems things are installed correctly on your system.

Although many samples will not run due to lack of hardware support.

Are you sure your clInfo do not show gpu as a device.

If problem persists i would suggest a fresh driver installation after running a driver sweeper.

0 Likes

driver is seems installed properly. but you have most likely old version. most likely you have catalyst 10.4 which are in ubuntu repository. (if they do not push newer version). so you need downlod newes veriosn. from amd.com.

follow this instructions http://wiki.cchtml.com/index.php/Ubuntu_Lucid_Installation_Guide#Installing_the_drivers_manually

0 Likes

Thank you very much, after updating the drivers manually it worked, now CLInfo can see 2 devices

0 Likes

Originally posted by: ealbayrak Thank you very much, after updating the drivers manually it worked, now CLInfo can see 2 devices


Hello, ealbayrak, what distribution and kernel version did you use?

I'm using Ubuntu 10.04 and upgrade the kernel to 2.6.32-25-generic.

After following the instructions provided by nou's link, I got the following error message:

===============================================================
sudo dpkg -i *.deb
Selecting previously deselected package fglrx.
(Reading database ... 246090 files and directories currently installed.)
Unpacking fglrx (from fglrx_8.771-0ubuntu1_amd64.deb) ...
Selecting previously deselected package fglrx-amdcccle.
Unpacking fglrx-amdcccle (from fglrx-amdcccle_8.771-0ubuntu1_amd64.deb) ...
Selecting previously deselected package fglrx-dev.
Unpacking fglrx-dev (from fglrx-dev_8.771-0ubuntu1_amd64.deb) ...
Selecting previously deselected package fglrx-modaliases.
Unpacking fglrx-modaliases (from fglrx-modaliases_8.771-0ubuntu1_amd64.deb) ...
Setting up fglrx (2:8.771-0ubuntu1) ...
Loading new fglrx-8.771 DKMS files...
Building only for 2.6.32-25-generic
Building for architecture x86_64
Building initial module for 2.6.32-25-generic

Error! Bad return status for module build on kernel: 2.6.32-25-generic (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/fglrx/8.771/build/ for more information.
dpkg: error processing fglrx (--install):
subprocess installed post-installation script returned error exit status 10
dpkg: dependency problems prevent configuration of fglrx-amdcccle:
fglrx-amdcccle depends on fglrx; however:
Package fglrx is not configured yet.
dpkg: error processing fglrx-amdcccle (--install):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of fglrx-dev:
fglrx-dev depends on fglrx; however:
Package fglrx is not configured yet.
dpkg: error processing fglrx-dev (--install):
dependency problems - leaving unconfigured
Setting up fglrx-modaliases (2:8.771-0ubuntu1) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for python-support ...
Errors were encountered while processing:
fglrx
fglrx-amdcccle
fglrx-dev
===============================================================


I check make.log under make.log under /var/lib/dkms/fglrx/8.771/build, and it shows:

===============================================================
DKMS make.log for fglrx-8.771 for kernel 2.6.32-25-generic (x86_64)
Wed Sep 29 11:58:07 CEST 2010
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.GCC* .??* *.symvers
make -C /lib/modules/2.6.32-25-generic/build SUBDIRS=/var/lib/dkms/fglrx/8.771/build/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-25-generic'
CC /var/lib/dkms/fglrx/8.771/build/2.6.x/firegl_public.o
CC /var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_acpi.o
CC /var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_agp.o
CC /var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_debug.o
CC /var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_ioctl.o
/var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_ioctl.c: In function ‘KCL_IOCTL_AllocUserSpace32':
/var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_ioctl.c:196: error: implicit declaration of function ‘compat_alloc_user_space'
/var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_ioctl.c:196: warning: return makes pointer from integer without a cast
make[2]: *** [/var/lib/dkms/fglrx/8.771/build/2.6.x/kcl_ioctl.o] Error 1
make[1]: *** [_module_/var/lib/dkms/fglrx/8.771/build/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-25-generic'
make: *** [kmod_build] Error 2
build failed with return value 2
===============================================================

I'm sure that my graphic card is ok cause I tested it with environment "kernel 2.6.32-25-generic + catalyst 10.4 which are in ubuntu repository + ATI SDK 2.1" and many samples such as SimpleGL and NBody works well.

Did I miss something to do ?? Thanks~

 

0 Likes

roll back to 2.6.32-24

google "compat_alloc_user_space fglrx" and you see that there is patch which break fglrx. AMD should fix this in 10.10

0 Likes

Originally posted by: nou roll back to 2.6.32-24

 

google "compat_alloc_user_space fglrx" and you see that there is patch which break fglrx. AMD should fix this in 10.10

 

Rolling back 2.6.32-24 still has the problem. As I keep rolling back to older kernel, I notice that 2.6.32-21 is ok.

Thank you, nou, I'll keep trying. At least I know that is kind of source code conflict between kernel and ATI driver. Hope next driver release will fix this issue. Thanks.

 

0 Likes

1. build the fglrx .deb from ati-driver-installer-10-9-*.run.

2. extract files with "dpkg-deb -x fglrx_8.*.deb", extract control info "dpkg-deb -e fglrx_8.*.deb", place folder DEBIAN inside files folder.

3. edit kcl_ioctl.c (located somewhere inside src folder) last function to this:

"void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)

 

{ void __user *space; space = arch_compat_alloc_user_space(size); /* Avoid CVE-2010-3081 by checking access_ok ourselves */ if (!access_ok(VERIFY_WRITE, space, size)) { return NULL; } return space; }"
4. build .deb package again with "dpkg-deb -b <files folder>"
5. install, "aticonfig --initial -f [--adapter=all]", reboot. done
0 Likes

Originally posted by: eklund.n 1. build the fglrx .deb from ati-driver-installer-10-9-*.run.

 

2. extract files with "dpkg-deb -x fglrx_8.*.deb", extract control info "dpkg-deb -e fglrx_8.*.deb", place folder DEBIAN inside files folder.

 

3. edit kcl_ioctl.c (located somewhere inside src folder) last function to this:

 

"void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)

 

 

 

{ void __user *space; space = arch_compat_alloc_user_space(size); /* Avoid CVE-2010-3081 by checking access_ok ourselves */ if (!access_ok(VERIFY_WRITE, space, size)) { return NULL; } return space; }"
4. build .deb package again with "dpkg-deb -b "
5. install, "aticonfig --initial -f [--adapter=all]", reboot. done

Thanks you eklund.n !! Now I've successfully installed the driver 10.9 with kernel 2.6.32-25 and ATI SDK 2.2 works well. Thanks nou and eklund.n, both of you help a lot !!

Let me share my steps of the solution to install ATI driver 10.9 over Ubuntu 10.04 with kernel 2.6.32-25 in case someone else has the same problem as mine. (Note: I am using x86_64 architecture.)

 

First, remember to install the prerequisite packages:

  $ sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0

  $ sudo apt-get install ia32-libs

 

Second, download the driver 10.9 and then create .deb packages.

  $ cd ~/; mkdir catalyst10.9; cd catalyst10.9/

  $ wget http://www2.ati.com/drivers/linux/ati-driver-installer-10-9-x86.x86_64.run

  $ sh ati-driver-installer-10-9-x86.x86_64.run --buildpkg Ubuntu/lucid

 

Third,extract source files from .deb, modify source, repack it, and then install driver in general way:

  $ dpkg-deb -x fglrx_8.*.deb fglrx_8.771-0ubuntu1_amd64

  $ mkdir fglrx_8.771-0ubuntu1_amd64/DEBIAN

  $ dpkg-deb -e fglrx_8.*.deb fglrx_8.771-0ubuntu1_amd64/DEBIAN

  (edit kcl_ioctl.c as eklund.n posted)

  $ mv fglrx_8.771-0ubuntu1_amd64.deb fglrx_8.771-0ubuntu1_amd64.bak

  $ dpkg-deb -b fglrx_8.771-0ubuntu1_amd64/

  $ sudo dpkg -i fglrx*.deb

  $ aticonfig --initial -f

 

After reboot we have successfully installed the driver. Thanks all.

 

0 Likes

Originally posted by: jasonwucj

 

Let me share my steps of the solution to install ATI driver 10.9 over Ubuntu 10.04 with kernel 2.6.32-25 in case someone else has the same problem as mine. (Note: I am using x86_64 architecture.)

 

 

Ooops~~ after I posted this article, I notice that AMD has release 10.9 hotfix for the issue ~~

http://support.amd.com/us/kbarticles/Pages/GPU83ATICatalystLinuxHotfix.aspx

That's great !! With this 10.9 hotfix we don't have to process the source by our own !! Thanks !!

0 Likes

now look at that... 😃

0 Likes