Discussion:
[lfs-support] Illegal instructions when trying to bring up a Ryzen
Ken Moffat
2018-03-28 00:49:44 UTC
Permalink
Thought I'd mention this here, because with current gcc the use (or
omission!) of -march in CFLAGS isn't doing what I had expected.

Background: my buildscripts are on nfs, as are my sources, so in the
past I've found it convenient to bring up a new machine by building
what I hope will be a suitable LFS on an existing system, fixing up
the kernel, and then copying it over - usually followed by sorting
out changes to video drivers / kernel config / hardware monitoring.

The new box is my first Ryzen (nothing fancy, just an R3 1300X for
four real cores with good cache sizes), and I was hoping to use the
initial system to get to grips with whatever I may, or may not, need
to do to get nouveau running. Recently I've been using
-march=native in my CFLAGS (in the hope that compilation might be
less slow), but for this build I dropped that and made sure that gmp
used config.fsf.

It booted fine on the build machine (a Kaveri, model 15h), but when
I copied it over and tried to chroot from SystemRescueCD I got
'illegal instruction'. Eventually I dug out an OpenSuse disk and
tried that in recovery mode: same result, but it told me the problem
was in ld-2.27.so.

Googling around, I came upon old gentoo threads where -march=k8 was
recommended because Ryzens omit 4 instructions which were available
on Excavator CPUs. Return to start, do not pass go, do not collect
200 currency-units. So, I tried that. But the same result. That is
what really concerns me.

Then I got lucky - saved the kernel, modules, .config and tried
loading a backup from a different machine (an AMD Phenom - much
earlier x86_64, I think that is fam 10h) - with that I could chroot
from SystemRescueCD. Installed grub, fixed things up, booted. But
that wasn't a minimal system, so I've deferred looking at whatever
nouveau may, or may not, need for Xorg on this hardware (it's only a
GT710 - the bottom of the range, no fan and a vga output). It is now
getting towards the end of chapter 6 in a native build.

I'm really mentioning this in case anybody else gets a Ryzen and
tries the same approach.

ĸen
--
Before the universe began, there was a sound. It went: "One, two, ONE,
two, three, four" [...] The cataclysmic power chord that followed was
the creation of time and space and matter and it does Not Fade Away.
- wiki.lspace.org/mediawiki/Music_With_Rocks_In
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipe
Baho Utot
2018-03-28 01:48:35 UTC
Permalink
Post by Ken Moffat
Thought I'd mention this here, because with current gcc the use (or
omission!) of -march in CFLAGS isn't doing what I had expected.
[putolin]
Post by Ken Moffat
I'm really mentioning this in case anybody else gets a Ryzen and
tries the same approach.
ĸen
When I use -march I use the following:

-march=x86-64 -mtune=generic

This makes LFS work on all my AMD machines ( total of 4 ) all 10 years
or older. Don't know if the same would work for Ryzen unless you give
it a go.
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/P
Ken Moffat
2018-03-28 02:06:23 UTC
Permalink
Post by Baho Utot
Post by Ken Moffat
Thought I'd mention this here, because with current gcc the use (or
omission!) of -march in CFLAGS isn't doing what I had expected.
[putolin]
Post by Ken Moffat
I'm really mentioning this in case anybody else gets a Ryzen and
tries the same approach.
ĸen
-march=x86-64 -mtune=generic
This makes LFS work on all my AMD machines ( total of 4 ) all 10 years or
older. Don't know if the same would work for Ryzen unless you give it a go.
Thanks, but I'll leave that for somebody else to try. It certainly
sounds as if it ought to work, but I've now got it to a stage where
it builds LFS conventionally so I don't have any need to build the
binaries on a slower system. Too much else to get on with (firefox,
gimp-2.10, TeXlive-2018) plus whatever else turns up.

I'll note that using those options probably allows a build on an
intel (or on an AMD and then transfer to an intel), so it is an
interesting suggestion.

ĸen
--
Before the universe began, there was a sound. It went: "One, two, ONE,
two, three, four" [...] The cataclysmic power chord that followed was
the creation of time and space and matter and it does Not Fade Away.
- wiki.lspace.org/mediawiki/Music_With_Rocks_In
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Pos
Nick Lazos
2018-03-29 11:30:26 UTC
Permalink
Post by Ken Moffat
Thought I'd mention this here, because with current gcc the use (or
omission!) of -march in CFLAGS isn't doing what I had expected.
Background: my buildscripts are on nfs, as are my sources, so in the
past I've found it convenient to bring up a new machine by building
what I hope will be a suitable LFS on an existing system, fixing up
the kernel, and then copying it over - usually followed by sorting
out changes to video drivers / kernel config / hardware monitoring.
The new box is my first Ryzen (nothing fancy, just an R3 1300X for
four real cores with good cache sizes), and I was hoping to use the
initial system to get to grips with whatever I may, or may not, need
to do to get nouveau running. Recently I've been using
-march=native in my CFLAGS (in the hope that compilation might be
less slow), but for this build I dropped that and made sure that gmp
used config.fsf.
It booted fine on the build machine (a Kaveri, model 15h), but when
I copied it over and tried to chroot from SystemRescueCD I got
'illegal instruction'. Eventually I dug out an OpenSuse disk and
tried that in recovery mode: same result, but it told me the problem
was in ld-2.27.so.
Googling around, I came upon old gentoo threads where -march=k8 was
recommended because Ryzens omit 4 instructions which were available
on Excavator CPUs. Return to start, do not pass go, do not collect
200 currency-units. So, I tried that. But the same result. That is
what really concerns me.
Then I got lucky - saved the kernel, modules, .config and tried
loading a backup from a different machine (an AMD Phenom - much
earlier x86_64, I think that is fam 10h) - with that I could chroot
from SystemRescueCD. Installed grub, fixed things up, booted. But
that wasn't a minimal system, so I've deferred looking at whatever
nouveau may, or may not, need for Xorg on this hardware (it's only a
GT710 - the bottom of the range, no fan and a vga output). It is now
getting towards the end of chapter 6 in a native build.
I'm really mentioning this in case anybody else gets a Ryzen and
tries the same approach.
For Rysen i use these flags: -march=x86-64 -mtune=generic -mno-fma4
-mno-tbm -mno-xop -mno-lwp

The no-fma4 etc are flags for instruntions that rysen does not have.
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wik
Ken Moffat
2018-03-30 00:53:36 UTC
Permalink
Post by Nick Lazos
Post by Ken Moffat
Thought I'd mention this here, because with current gcc the use (or
omission!) of -march in CFLAGS isn't doing what I had expected.
[...]
Post by Nick Lazos
Post by Ken Moffat
Then I got lucky - saved the kernel, modules, .config and tried
loading a backup from a different machine (an AMD Phenom - much
earlier x86_64, I think that is fam 10h) - with that I could chroot
from SystemRescueCD. Installed grub, fixed things up, booted. But
that wasn't a minimal system, so I've deferred looking at whatever
nouveau may, or may not, need for Xorg on this hardware (it's only a
GT710 - the bottom of the range, no fan and a vga output). It is now
getting towards the end of chapter 6 in a native build.
For Rysen i use these flags: -march=x86-64 -mtune=generic -mno-fma4
-mno-tbm -mno-xop -mno-lwp
The no-fma4 etc are flags for instruntions that rysen does not have.
Thanks. Meanwhile I'm very much regretting using the GT710 - fine
in a tty (but I doubt I need nouveau to get a 1024x768 framebuffer),
and so far apparently two different issues causing X to lock up (one
of them had written thousands of lines to syslog). Looks like it
isn't going to be usable at the moment. Will raise bugs after
either libreoffice completes (a somewhat full build in terms of
languages) or I find Xorg has locked up again.

ĸen
--
Before the universe began, there was a sound. It went: "One, two, ONE,
two, three, four" [...] The cataclysmic power chord that followed was
the creation of time and space and matter and it does Not Fade Away.
- wiki.lspace.org/mediawiki/Music_With_Rocks_In
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

ht
Loading...