6 Replies Latest reply on Oct 13, 2010 4:35 PM by MicahVillmow

    Linux GUI hangs on opencl kernel running on GPU

    spyzer.abhishek0

      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.

        • Linux GUI hangs on opencl kernel running on GPU
          MicahVillmow
          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.
          • Linux GUI hangs on opencl kernel running on GPU
            MicahVillmow
            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.

              • Linux GUI hangs on opencl kernel running on GPU
                spyzer.abhishek0

                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??

              • Linux GUI hangs on opencl kernel running on GPU
                MicahVillmow
                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.