All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
@ 2016-06-11  0:55 bugzilla-daemon
  2016-06-11  0:55 ` bugzilla-daemon
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-11  0:55 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1536 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

            Bug ID: 96488
           Summary: [r600g]OpenCL driver causes segfault in ImageMagick's
                    Histogram kernel
           Product: Mesa
           Version: git
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/Gallium/r600
          Assignee: dri-devel@lists.freedesktop.org
          Reporter: nixscripter@gmail.com
        QA Contact: dri-devel@lists.freedesktop.org

Created attachment 124469
  --> https://bugs.freedesktop.org/attachment.cgi?id=124469&action=edit
Histogram kernel backtrace

If I compile ImageMagick with OpenCL support, the current version segfaults
when I attempt to do any operation which computes a histogram. This is actually
done frequently internally, so it's more crippling than it first appears.

To reproduce:

1. Get the current latest ImageMagick from GitHub:
https://github.com/ImageMagick/ImageMagick

2. Compile it with OpenCL support (--enable-opencl flag)

3. Get an image, and try to equalize its colors (based on the histogram):

convert input.png -equalize output.png

4. The segfault will occur

LLVM version: r272184
Mesa version: commit d5491a8
ImageMagick version: ade0d8e

The source code for the Histogram kernel is in
MagickCore/accelerate-kernels-private.h, starting on line 1283.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3111 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
@ 2016-06-11  0:55 ` bugzilla-daemon
  2016-06-11  3:26 ` bugzilla-daemon
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-11  0:55 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 427 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

nixscripter@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|All                         |Linux (All)
           Hardware|Other                       |x86-64 (AMD64)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
  2016-06-11  0:55 ` bugzilla-daemon
@ 2016-06-11  3:26 ` bugzilla-daemon
  2016-06-11 11:45 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-11  3:26 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 324 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #1 from jano.vesely@gmail.com ---
That's because global atomics are not implemented in LLVM backend (despite
driver advertising the extensions).
Shouldn't be too hard to them.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1131 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
  2016-06-11  0:55 ` bugzilla-daemon
  2016-06-11  3:26 ` bugzilla-daemon
@ 2016-06-11 11:45 ` bugzilla-daemon
  2016-06-11 13:47 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-11 11:45 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 673 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #2 from Vedran Miletić <vedran@miletic.net> ---
(In reply to jano.vesely from comment #1)
> That's because global atomics are not implemented in LLVM backend (despite
> driver advertising the extensions).
> Shouldn't be too hard to them.

Are you sure the hardware has the necessary instructions? Tom Stellard
commented on #radeon back in November that implementing global atomics for
r600g will be very very difficult[1].

[1]
https://people.freedesktop.org/~cbrill/dri-log/index.php?date=2015-11-27&channel=radeon

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1684 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (2 preceding siblings ...)
  2016-06-11 11:45 ` bugzilla-daemon
@ 2016-06-11 13:47 ` bugzilla-daemon
  2016-06-11 19:15 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-11 13:47 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 525 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #3 from nixscripter@gmail.com ---
I suspected it was that, based on the word "Atomic" being at fault.

Unfortunately, I cannot assist, as I'm not an expert on parallel architecture
and spending the last half hour reading AMD's documentation won't make me one.
But I would ask one question: is anyone even working on this? I'd hate to write
off ImageMagick on this platform.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1342 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (3 preceding siblings ...)
  2016-06-11 13:47 ` bugzilla-daemon
@ 2016-06-11 19:15 ` bugzilla-daemon
  2016-06-12 12:41 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-11 19:15 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 527 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #4 from jano.vesely@gmail.com ---
The instructions are there for EG+. They're tricky to implement because of the
register requirements. However, there might be some weird interaction when
using CB with the current stores, and loads from the same WI.

I had a version that passed noret variant of global atomic piglit tests, but
I'm not sure piglit tests cover all situations.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1334 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (4 preceding siblings ...)
  2016-06-11 19:15 ` bugzilla-daemon
@ 2016-06-12 12:41 ` bugzilla-daemon
  2016-06-12 23:13 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-12 12:41 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 310 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #5 from Vedran Miletić <vedran@miletic.net> ---
Can you dig the patch somewhere? I have a Caicos at hand and I would really
like to test atomic compare-and-swap.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1135 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (5 preceding siblings ...)
  2016-06-12 12:41 ` bugzilla-daemon
@ 2016-06-12 23:13 ` bugzilla-daemon
  2016-12-23  5:45 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-06-12 23:13 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 814 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #6 from Jan Vesely <jano.vesely@gmail.com> ---
(In reply to Vedran Miletić from comment #5)
> Can you dig the patch somewhere? I have a Caicos at hand and I would really
> like to test atomic compare-and-swap.

you can try my github branch [0], you'll need the last 5 patches (2-3 can be
skipped since it's just revert).
but I rebase a lot so things might brake.

It passes noret piglit tests, and _noret should work OK, _return variants will
give LLVM ERROR: Cannot select.
uncommenting the FIXME parts enables return variants, but it will brake for
more than one WI as every WI uses address 0 as scratchpad.

Jan

[0] https://github.com/jvesely/llvm

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1756 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (6 preceding siblings ...)
  2016-06-12 23:13 ` bugzilla-daemon
@ 2016-12-23  5:45 ` bugzilla-daemon
  2016-12-23 15:28 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-12-23  5:45 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 588 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #7 from nixscripter@gmail.com ---
Normally, I would be asking in this comment if there is any progress on this,
but I can tell there has been... change, at least.

Now instead of crashing, it deadlocks the calling process waiting on a mutex.
Forever, as far as I can tell.

LLVM version: r289770
Mesa version: commit 47351b843a

Perhaps this is more easily fixed? Or is this getting to the heart of the
matter implied in comment 2?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1434 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (7 preceding siblings ...)
  2016-12-23  5:45 ` bugzilla-daemon
@ 2016-12-23 15:28 ` bugzilla-daemon
  2016-12-29  3:25 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-12-23 15:28 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1134 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #8 from Jan Vesely <jv356@scarletmail.rutgers.edu> ---
(In reply to nixscripter from comment #7)
> Normally, I would be asking in this comment if there is any progress on
> this, but I can tell there has been... change, at least.
> 
> Now instead of crashing, it deadlocks the calling process waiting on a
> mutex. Forever, as far as I can tell.
> 
> LLVM version: r289770
> Mesa version: commit 47351b843a
> 
> Perhaps this is more easily fixed? Or is this getting to the heart of the
> matter implied in comment 2?

the hang is probably a separate bug. ImageMagick test suite results on my Turks
GPU are:
# TOTAL: 86
# PASS:  78
# SKIP:  0
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 5

the errors and failures are accompanied by:
Assertion `i < getNumRegs() && "Register number out of range!"' failed.

The patches to add support for noret atomics (should be good enough for
histogram) are at:
https://reviews.llvm.org/D27989
https://reviews.llvm.org/D28067

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2217 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (8 preceding siblings ...)
  2016-12-23 15:28 ` bugzilla-daemon
@ 2016-12-29  3:25 ` bugzilla-daemon
  2017-01-16 21:36 ` bugzilla-daemon
  2017-01-22  6:59 ` bugzilla-daemon
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2016-12-29  3:25 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 510 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #9 from nixscripter@gmail.com ---
I have downloaded LLVM r290690 which contains your first diff, manually applied
your 2nd diff, and compiled it. The resulting library seems to resolve the
issue.

Once that patch is reviewed and applied to the mainline, I will do one final
verification and (hopefully) close this bug.

Thanks for all your efforts on this!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1317 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (9 preceding siblings ...)
  2016-12-29  3:25 ` bugzilla-daemon
@ 2017-01-16 21:36 ` bugzilla-daemon
  2017-01-22  6:59 ` bugzilla-daemon
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2017-01-16 21:36 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 764 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

--- Comment #10 from Jan Vesely <jv356@scarletmail.rutgers.edu> ---
(In reply to nixscripter from comment #9)
> I have downloaded LLVM r290690 which contains your first diff, manually
> applied your 2nd diff, and compiled it. The resulting library seems to
> resolve the issue.
> 
> Once that patch is reviewed and applied to the mainline, I will do one final
> verification and (hopefully) close this bug.
> 
> Thanks for all your efforts on this!

I have just landed the patch. Note that if the kernel uses sub-int(short,char)
vectors. it will generate incorrect code until D27964 (or alternative) is
merged.

Jan

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 1687 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel
  2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
                   ` (10 preceding siblings ...)
  2017-01-16 21:36 ` bugzilla-daemon
@ 2017-01-22  6:59 ` bugzilla-daemon
  11 siblings, 0 replies; 13+ messages in thread
From: bugzilla-daemon @ 2017-01-22  6:59 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 562 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=96488

nixscripter@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #11 from nixscripter@gmail.com ---
I have just tried LLVM r292714, and it does indeed work as advertised. Marking
RESOLVED FIXED.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 2090 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-01-22  6:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-11  0:55 [Bug 96488] [r600g]OpenCL driver causes segfault in ImageMagick's Histogram kernel bugzilla-daemon
2016-06-11  0:55 ` bugzilla-daemon
2016-06-11  3:26 ` bugzilla-daemon
2016-06-11 11:45 ` bugzilla-daemon
2016-06-11 13:47 ` bugzilla-daemon
2016-06-11 19:15 ` bugzilla-daemon
2016-06-12 12:41 ` bugzilla-daemon
2016-06-12 23:13 ` bugzilla-daemon
2016-12-23  5:45 ` bugzilla-daemon
2016-12-23 15:28 ` bugzilla-daemon
2016-12-29  3:25 ` bugzilla-daemon
2017-01-16 21:36 ` bugzilla-daemon
2017-01-22  6:59 ` bugzilla-daemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.