cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spyzer_abhishek0
Journeyman III

Linux GUI hangs on opencl kernel running on GPU

Hi all,

I developed a kernel and after a lot of debugging with the compilation and runtime errors, I was finally able to run my opencl kernel.  But the moment it starts running, the entire desktop hangs. SSH could be done to the system but the on PC keyboard or mouse or any sort of interrupts do not show a response. I have a 64 bit toshiba laptop with mobility radeon hd 4500 series and am running 32 bit centos on it. Also tried 32 and 64 bit ubuntu 10.10 on it, but the same problem persists. Is this a bug, or is there some important step I am missing??? Please help urgently!!!

Thank You.

0 Likes
6 Replies

Make sure that you are checking the max kernel work group size before launching the kernel. There are issues with the 7XX based devices that could cause GUI to become unresponsive if this check is not done. Also if you can supply a test case we can look to see the exact cause of the GUI hang.
0 Likes

Well i am alloting only 2 work items while my GPU supports a max of 128. If you wish to check out the kernel code, here it is http://pastebin.ca/1960646. I would love this problem to be resolved.

0 Likes

spyzer.abhishek0,

Have you tried letting the kernel execute after hang.

Hang down or desktop freezing are quite common while kernels are run on GPUs.The reason being GPU is busy doing computation so it cannot refresh the screen during that time.In such cases it appears that computer is not responding to keyboard or mouse,but actually just the screen does not get refreshed.For the same reason OS provides a watchdog timer which checks if the screen is not refreshed, for a maximum of  5 sec, it interrupts the GPU and restarts it.

I checked your code in SKA, and parameters are generated just  fine.I will check the code and update if i find any problem with the code.

Thanks

0 Likes

spyzer,
While this code should work on the GPU. I do believe it will take a LONG time to run. The problem is that you are treating the GPU like a dual-core CPU., therefor you are utilizing only a fraction of a percent of the power of the GPU. Second, you are nesting loops instead of doing the work in parallel. Why are you running 2 work-items instead of 1000's? The GPU supports a max of 128 work-items per work-group, not 128 work-items max.
Also, using private arrays are currently inefficient on the GPU because they are uncached reads and writes to memory.
int tmp_row[2000]; <--- slow....
int tmp_tmp_row[2000]; <--- slow....

This is why local memory is provided as a software managed cache to get very high bandwidth.

0 Likes

okay if that's the case, then I would like to ask two more things:

1 - May anyone suggest me how to run those nested loops parallelly as well. Do i need to make another kernel, or do i need to change my logic of implementation??

2 - Is there any way that my GUI doesn't make use of graphics card on the system so that when I am using opencl on GPU, the GUI doesn't crash??

0 Likes

spyzer,
If you run on a graphics card that isn't running your display, you won't have the issue for #2.

For #1, the logic of your implementation is inefficient. Look and understand how dense matrix multiplication works from the SDK samples first and then you should be able to get an idea of how to write the kernel more efficiently.
0 Likes