cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

markuswalter
Journeyman III

Segmentation Fault in every sample

Hi,

I would like to get started with OpenCL, a Radeon HD 68xx and Linux (Debian 6 x86_64, X11, Catalyst 11.1, AMD Stream SDK 2.6).

Installing the stream SDK worked fine, but whenever I run a sample application, I get a SIGSEGV.

What did I do wrong?

/opt/AMDAPP/samples/opencl/bin/x86_64$ gdb ./HelloCL

GNU gdb (GDB) 7.3.1

Copyright (C) 2011 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-unknown-linux-gnu".

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>...

No symbol table is loaded.  Use the "file" command.

Catchpoint 1 (throw)

Reading symbols from /opt/AMDAPP/samples/opencl/bin/x86_64/HelloCL...done.

(gdb) r

Starting program: /opt/AMDAPP/samples/opencl/bin/x86_64/HelloCL

[Thread debugging using libthread_db enabled]

HelloCL!

Getting Platform Information

Program received signal SIGSEGV, Segmentation fault.

0x00007ffff7555a13 in std::string::_Rep::_M_dispose () from /usr/local/lib64/libstdc++.so.6

(gdb) bt

#0  0x00007ffff7555a13 in std::string::_Rep::_M_dispose () from /usr/local/lib64/libstdc++.so.6

#1  0x00007ffff7555a63 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() () from /usr/local/lib64/libstdc++.so.6

#2  0x00007ffff565f78a in ?? () from /usr/lib/libamdocl64.so

#3  0x00007ffff565fdae in ?? () from /usr/lib/libamdocl64.so

#4  0x00007ffff566a1f4 in ?? () from /usr/lib/libamdocl64.so

#5  0x00007ffff566c4de in ?? () from /usr/lib/libamdocl64.so

#6  0x00007ffff561bc50 in ?? () from /usr/lib/libamdocl64.so

#7  0x00007ffff56263d9 in ?? () from /usr/lib/libamdocl64.so

#8  0x00007ffff56504df in ?? () from /usr/lib/libamdocl64.so

#9  0x00007ffff5653c8f in ?? () from /usr/lib/libamdocl64.so

#10 0x00007ffff565437f in ?? () from /usr/lib/libamdocl64.so

#11 0x00007ffff5619f53 in ?? () from /usr/lib/libamdocl64.so

#12 0x00007ffff56291b5 in ?? () from /usr/lib/libamdocl64.so

#13 0x00007ffff55f3881 in clGetPlatformInfo () from /usr/lib/libamdocl64.so

#14 0x00007ffff77bae8d in ?? () from /usr/lib/libOpenCL.so.1

#15 0x00007ffff77bcc13 in ?? () from /usr/lib/libOpenCL.so.1

#16 0x00007ffff77bc320 in clGetPlatformIDs () from /usr/lib/libOpenCL.so.1

#17 0x0000000000402fdb in cl::Platform::get(std::vector<cl::Platform, std::allocator<cl::Platform> >*) ()

#18 0x0000000000401d1d in main ()

(gdb)

0 Likes
6 Replies
n_todoroff
Adept I

Hi Markus,

I had the same problem a couple of days ago with Debian. There seems to be a conflict between the OpenCL libraries of Catalyst and the AMDAPPSDK.

I installed Catalyst, then the AMDAPPSDK. Then everything compiled fine but all the samples and my code, which worked perfectly under MacOS exited with a segmentation fault.

I solved it by reinstalling the Catalyst with the --force option from a terminal inside X.org. Now everything works like a breeze. Don't touch the AMDAPPSDK, simply reinstall the driver

Cheers,

Nickolay

Hey Nickolay,

thanks four your reply. Unfortunately reinstalling Catalyst did not help. I am still getting the very same SIGSEGV/backtrace.

Greetings from Hamburg

Markus

0 Likes

Hmm...

that's curious. I suppose You rebuilt the sample binaries? I did a simple make clean & make.

Are You using Catalyst 11.1 or 12.1? I suppose You used the latest driver and APPSDK. If not, then try it again with the latest ones (everything You use must be the 64 bit version).

There is one more possibility that may be the reason for Your trouble and it is the PAT kernel module. You can edit your GRUB configuration so that it doesn't load the PAT module from Debian on boot and load the Catalyst's PAT instead. I assume You are running the standard 64 bit Kernel, so the easiest way to do it is to duplicate the GRUB entry You are using and add the nopat option at the end (/boot/grub/grub.cfg).

If I recall correctly, before reinstalling the Catalyst I ran the nopat GRUB entry first (no obvious reason, just frustration). Then i installed it and rebooted again under the nopat entry. Then did a make clean and make and it worked. Right now I am crunching numbers and am running the normal kernel PAT, so after You make it work once, it should not be needed any more.

You can check which GRUB line You used when starting Your system by:

dmesg | grep -i pat

It should return something like

...

...

...

[   26.714352] [fglrx] Kernel PAT support is enabled

...

...

or it should tell You that the kernel PAT module is disabled and that the driver PAT is loaded.

Wish You luck and hang in there!

Cheers,

Nickolay

Hey Nickolay,

thank you so much for your help!

I am using Catalyst 12.1 and the latest APPSDK (2.6 final and 2.6 RC3). I also rebuild all samples. This crash is not specific to the samples, though. A third party application that uses OpenCL crashes as well, with the very same Segfault.

I also disabled pat. It did not help

~$ dmesg | grep -i pat

[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-2.6.32-5-amd64 root=/dev/mapper/sda5_crypt ro nopat quiet

[    0.616100] io scheduler anticipatory registered

[    0.762796] ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14

[    0.762799] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15

[   21.886014] [fglrx] Kernel supports PAT but it has been disabled

[   21.886016] [fglrx] Using driver built-in PAT support instead

[   21.887649] [fglrx] Driver built-in PAT support is enabled successfully

Greetings from Hamburg

Markus

0 Likes

Hi Markus,

sorry for not being able to help you solve Your problem.  I hope that someone more proficient (where are you, AMD guys and girls) is going to engage this issue.

If You find a solution in the meantime, please post it here.

PS: Is it a fresh Debian install? And which version of Debian are You using? I'm running Squeeze 6.03 64 bit. My GCC is version 4.4.5-8 straight from the repositories.

0 Likes

Hey Nickolay,

thank you so much for your help.

I am using Squeeze 6.0, but updated. GCC (4.6.2) is built from source.

Greetings from Hamburg

Markus

0 Likes