Bug 82709

Summary: OpenCL not working on radeon hainan
Product: Mesa Reporter: Pali Rohár <pali.rohar>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: pali.rohar
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Work around for missing Hainan in clang

Description Pali Rohár 2014-08-16 19:23:25 UTC
OpenCL not working on Radeon HD 8690M card which has Hainan chip.

example hello world application shows this error log:

Build Log:
error: unknown target CPU 'hainan'

haagch on #dri-devel suggested me to:
$ sudo sed -i "s/tahiti/hainan/" /usr/lib/libMesaOpenCL.so

and after this "fix" I got:

Build Log:
fatal error: cannot open file '/usr/lib/clc/hainan-r600--.bc': No such file or directory

After that he suggested me to renaming tahiti-r600--.bc to hainan-r600--.bc which fixed that problem and OpenCL started working.

So problem is probably in clang and libclc -- that there is missing hainan name in cpu table.
Comment 1 Tom Stellard 2014-08-19 20:21:12 UTC
Created attachment 104915 [details] [review]
Work around for missing Hainan in clang

Does it work with this Mesa patch?
Comment 2 Ilia Mirkin 2014-08-19 20:25:43 UTC
(In reply to comment #1)
> Created attachment 104915 [details] [review] [review]
> Work around for missing Hainan in clang
> 
> Does it work with this Mesa patch?

missing break...
Comment 3 Pali Rohár 2014-08-20 08:42:21 UTC
I added missing break after both gpu = lines, recompiled mesa with that patch and opencl examples started working without above sed and symlink hacks.
Comment 4 Tom Stellard 2014-08-21 14:09:18 UTC
Fixed in git commit 8109664dedee588dc98c9a7c25bd40c0eb56c35f
Comment 5 Pali Rohár 2014-08-22 08:03:07 UTC
@Tom Stellard: Are you going to fix this problem in llvm/clang/libclc?
Comment 6 Alex Deucher 2014-08-22 12:25:26 UTC
(In reply to comment #5)
> @Tom Stellard: Are you going to fix this problem in llvm/clang/libclc?

IIRC, it's already working with newer versions of clang.
Comment 7 Tom Stellard 2014-08-22 17:10:15 UTC
(In reply to comment #5)
> @Tom Stellard: Are you going to fix this problem in llvm/clang/libclc?

Yes, it's fixed in llvm/clang 3.6 and I'll try to backport the patch for llvm/clang 3.5.1.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.