cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

Arturek
Journeyman III

[ROCm/OPenCL/Linux] Can not build OpenCL program

Hi,
 
I want to use rocM/OpenCL with my following setup:

  •  AMD CPU 5950
  • GPU 7900 XTX
  • Ubuntu 22.04.1 LTS

I installed the recommend amdgpu-install package, excuted 'amdgpu-install --opencl=rocr', rebooted and tried to compile run a simple OpenCL program - but it did a SIGSEGV.

The clinfo output shows me that it cannot build a program: 
.... 
ERROR: clBuildProgram(-11)

 
The log in my home directory ($HOME/.cache/pocl/kcache/HC/NCOMMENGDMGEMFMJPBGNJKKHLHLCCIGAOFJGH/build.log) shows: 'error: unknown target CPU 'generic''

I am stuck right now. Is this this a known bug, or can I fix this?
Any ideas are welcome!

0 Likes
1 Solution
dipak
Big Boss

Hi @Arturek ,

Thank you for reaching out. I have whitelisted you for the AMD Devgurus community.

From the list of ROCm-capable GPUs below, it looks like 7900 XTX is not officially supported yet.

https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.4.1/page/Prerequisites.html

Please note, for ROCm related support, you can use the github issue page below to post any issue/query.

https://github.com/RadeonOpenCompute/ROCm/issues

Thanks. 

View solution in original post

0 Likes
4 Replies
dipak
Big Boss

Hi @Arturek ,

Thank you for reaching out. I have whitelisted you for the AMD Devgurus community.

From the list of ROCm-capable GPUs below, it looks like 7900 XTX is not officially supported yet.

https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.4.1/page/Prerequisites.html

Please note, for ROCm related support, you can use the github issue page below to post any issue/query.

https://github.com/RadeonOpenCompute/ROCm/issues

Thanks. 

0 Likes

Is there any official announcement available, if or when the 7900 XTX will be supported? Or a timeline...?

0 Likes

I am not aware of any ETA for 7900 XTX support. If there is any update on this, I think the information should be available on the ROCm site itself. 

Thanks.

0 Likes
NickHock
Adept I

OpenCL _does_work_ on many AMD GPUs that are "not officially supported".

For a simple C file with a .cl kernel file, the compile command would look something like this:

      gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o add_numbers add_numbers.c -lOpenCL

The following Makefile _may_ help you to compile OpenCL for AMD GPUs 

https://github.com/rsnemmen/OpenCL-examples/blob/e2c34f1dfefbd265cfb607c2dd6c82c799eb322a/add_number...

Note the lines

# Check for Linux-AMD
ifdef AMDAPPSDKROOT
INC_DIRS=. $(AMDAPPSDKROOT)/include
ifeq ($(PROC_TYPE),)
LIB_DIRS=$(AMDAPPSDKROOT)/lib/x86
else
LIB_DIRS=$(AMDAPPSDKROOT)/lib/x86_64
endif
else

Also:

You very probably need to set the "local_workgroup_size" and "global_workgroup_size" everywhere that clEnqueueNDRangeKernel(...) is called.

"local_workgroup_size"  should be less-than-or-equal-to "Max work group size" from clinfo,

 256 for my Rx6400, possibly the same for your Rx7900 xtx. Usually you would choose a power of two,  (2^integer).

"global_workgroup_size" should be  'the total number of work items'   divided by "local_workgroup_size".

Obviously, if you hard code these then you are writing for one model of GPU. Better would be to query the device parameters when you create the clContext for that clPlatform and clDevice.


0 Likes