FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 05-01-2011, 06:30 AM
David Timms
 
Default illegal instruction - create compile variants ?

Hi, a user of rakarrack was getting startup exception SIGILL [1].

Seems the config/make/compile process for this app checks CPU capability
of the machine it is being compiled on, and applies optimisations that
are available on that processor.

The user has a much older processor.

Upstream suggest [2] that distros could add a script to detect runtime
CPU, and call the appropriately compiled executable.

To do that in rpm, I think I would need to call configure a second time.
Also, the new compile would overwrite the first compile, so it doesn't
seem that easy.

Any suggestions on a way forward ?


[1] https://bugzilla.redhat.com/show_bug.cgi?id=700183

[2] http://rakarrack.sourceforge.net/FAQ.html
[Why when I run rakarrack I receive a "Illegal Instruction" message?]
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 06:47 AM
Ralf Corsepius
 
Default illegal instruction - create compile variants ?

On 05/01/2011 08:30 AM, David Timms wrote:
> Hi, a user of rakarrack was getting startup exception SIGILL [1].
>
> Seems the config/make/compile process for this app checks CPU capability
> of the machine it is being compiled on, and applies optimisations that
> are available on that processor.
>
> The user has a much older processor.
>
> Upstream suggest [2] that distros could add a script to detect runtime
> CPU, and call the appropriately compiled executable.
>
> To do that in rpm, I think I would need to call configure a second time.
> Also, the new compile would overwrite the first compile, so it doesn't
> seem that easy.
>
> Any suggestions on a way forward ?

Rpm's and Fedora's philosophy is to let rpm specify/dictate CFLAGS,
which packages are supposed to respect.

Ralf

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 07:14 AM
David Timms
 
Default illegal instruction - create compile variants ?

On 01/05/11 16:47, Ralf Corsepius wrote:
> Rpm's and Fedora's philosophy is to let rpm specify/dictate CFLAGS,
> which packages are supposed to respect.
Yes, I still have VSs bug (514991) regarding opt flags still open.

So, for the lesser CPU problem, does that mean I just suggest, rebuild
srpm on their machine ?

Can I add that minimum CPU requirement to package description ?

If a user wanted to rebuild srpm for their CPU, would it be acceptable
to place some sort of conditional in the spec make line, so that the
local CPU build could use a suitable Instruction Set ?

Would it still be worth adding a CPU detect script to avoid abrt traces
from non-compatible CPU machines. In this case, could it just exit, or
leave a message to suggest the user to obtain and rebuild the srpm ?
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 07:41 AM
Hans de Goede
 
Default illegal instruction - create compile variants ?

Hi,

On 05/01/2011 09:14 AM, David Timms wrote:
> On 01/05/11 16:47, Ralf Corsepius wrote:
>> Rpm's and Fedora's philosophy is to let rpm specify/dictate CFLAGS,
>> which packages are supposed to respect.
> Yes, I still have VSs bug (514991) regarding opt flags still open.
>
> So, for the lesser CPU problem, does that mean I just suggest, rebuild
> srpm on their machine ?
>
> Can I add that minimum CPU requirement to package description ?
>
> If a user wanted to rebuild srpm for their CPU, would it be acceptable
> to place some sort of conditional in the spec make line, so that the
> local CPU build could use a suitable Instruction Set ?
>
> Would it still be worth adding a CPU detect script to avoid abrt traces
> from non-compatible CPU machines. In this case, could it just exit, or
> leave a message to suggest the user to obtain and rebuild the srpm ?

Erm, specifying a minimum support CPU in the package description is
not acceptable IMHO. The fix here is to patch the packages buildsystem,
so that it gets build for the minimum cpu level which is supported by
Fedora, and thus will work out of the box on all systems Fedora
supports.

No tricks / hacks with multiple compilation, cpu detect scripts, etc.
will be necessary then.

Regards,

Hans
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 07:56 AM
David Timms
 
Default illegal instruction - create compile variants ?

On 01/05/11 17:41, Hans de Goede wrote:
> Erm, specifying a minimum support CPU in the package description is
> not acceptable IMHO. The fix here is to patch the packages buildsystem,
> so that it gets build for the minimum cpu level which is supported by
> Fedora, and thus will work out of the box on all systems Fedora
> supports.
Where is that stated currently, and for older releases ?

> No tricks / hacks with multiple compilation, cpu detect scripts, etc.
> will be necessary then.
Though it comes at the cost of audio lag/latency increase when we are
trying to achieve near real time (eg live guitar input to sound effect
generation output). Even on the my machine (4x core amd 3Ghz), the
calculations the app performs for difficult presets (convolution) can
cause jack to abort because rakarrack didn't finish it's calculations
before it was required to deliver data.

Should I be suggesting to upstream to attempt to detect CPU before
running non-available instructions, eg as part of app startup ?
Can that even be done (reliably) ?

Thanks for your input.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 10:29 AM
"Richard W.M. Jones"
 
Default illegal instruction - create compile variants ?

On Sun, May 01, 2011 at 05:56:57PM +1000, David Timms wrote:
> Should I be suggesting to upstream to attempt to detect CPU before
> running non-available instructions, eg as part of app startup ?
> Can that even be done (reliably) ?

This is exactly what they should be doing, and yes it can be done
reliably as many apps do this (start by looking at /proc/cpuinfo).

(I also looked at how Debian have packaged this, but they don't seem
to have fixed the problem at all).

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 10:46 AM
Reindl Harald
 
Default illegal instruction - create compile variants ?

Am 01.05.2011 09:56, schrieb David Timms:

> Should I be suggesting to upstream to attempt to detect CPU before
> running non-available instructions, eg as part of app startup ?
> Can that even be done (reliably)?

ffmpeg has since years a option "--enable-runtime-cpudetect" what makes the
binary a little larger but let it run on all CPUs with good performance

so yes, it is possible

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 08:14 PM
Kevin Kofler
 
Default illegal instruction - create compile variants ?

Hans de Goede wrote:
> Erm, specifying a minimum support CPU in the package description is
> not acceptable IMHO. The fix here is to patch the packages buildsystem,
> so that it gets build for the minimum cpu level which is supported by
> Fedora, and thus will work out of the box on all systems Fedora
> supports.
>
> No tricks / hacks with multiple compilation, cpu detect scripts, etc.
> will be necessary then.

+1

Packages MUST NOT require a newer CPU than Fedora itself.

Kevin Kofler

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 08:31 PM
Kevin Kofler
 
Default illegal instruction - create compile variants ?

David Timms wrote:
> Should I be suggesting to upstream to attempt to detect CPU before
> running non-available instructions, eg as part of app startup ?

Yes, this is the ONLY solution that's acceptable for binary packaging in
distributions. Otherwise, we can only build the most generic version. (The
current packages which enable whatever happens to be supported on the build
system are completely broken and shouldn't have passed review.)

> Can that even be done (reliably) ?

Yes, all the packages which have WORKING support for SSE etc. in Fedora do
that. See e.g.
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/solid/solid/backends/shared/cpufeatures.cpp
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/solid/solid/backends/udev/cpuinfo.cpp
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/solid/solid/backends/udev/udevprocessor.cpp
for the implementation Solid (in kdelibs) uses.

Kevin Kofler

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2011, 10:50 PM
David Timms
 
Default illegal instruction - create compile variants ?

On 02/05/11 06:31, Kevin Kofler wrote:
> David Timms wrote:
>> Should I be suggesting to upstream to attempt to detect CPU before
>> running non-available instructions, eg as part of app startup ?
Further, what can I run over an existing executable to detect what CPU
it was built for, ie what instuctions have been included ?

> Yes, all the packages which have WORKING support for SSE etc. in Fedora do
> that. See e.g.
> https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/solid/solid/backends/shared/cpufeatures.cpp
> https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/solid/solid/backends/udev/cpuinfo.cpp
> https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/entry/solid/solid/backends/udev/udevprocessor.cpp
> for the implementation Solid (in kdelibs) uses.
Thanks Kevin, I'll make the suggestion to developers, and see if they
are interested. Cheers, David.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 04:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org