Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [40d] Illegal Instruction  (Read 826 times)

Kalzarius

  • Escaped Lunatic
    • View Profile
[40d] Illegal Instruction
« on: April 01, 2009, 06:44:20 pm »

When attempting to run the 40d5, 40d6, and 40d11 (I didn't test the ones in between, but imagine they would do the same thing), all I get is "Illegal instruction" on my present Xubuntu system.  My best guess is that this has something to do with SSE instructions that my processor doesn't have that are not being checked for prior to use.  Perhaps it should fall back to something that doesn't use SSE if none are available?

I'd try it on my Windows system, but it's running Windows 98, which is apparently no longer supported.

 - Kal Zarius

« Last Edit: April 03, 2009, 10:47:34 am by Kalzarius »
Logged

ShadeJS

  • Bay Watcher
    • View Profile
Re: [40d] Illegal Instruction
« Reply #1 on: April 03, 2009, 07:38:43 am »

Leaving out the processor architecture and details probably doesn't help. An AMD K5? One of those VIA Chips? An early PIII? (Since you said Windows 98 or an Ubuntu derivative, I'm just guessing it's oldish.)
Logged

Kalzarius

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #2 on: April 03, 2009, 11:15:00 am »

Old though they are, they're all I have.

AMD Athlon 900MHz
ASUS motherboard
512MB of RAM

I know for certain both systems (identical hardware) have no SSE support, although I believe they do have AMD 3D Now!.  Since it's saying "Illegal instruction", I assume that it's trying to use a processor instruction that is unsupported by the CPU, and SSE seems the most likely.  If that's the case, the code does not fall back to non-SSE instructions when SSE instructions are not available.

If it's not SSE, I have no way of checking if it's something about the Xubuntu installation (short of some form of debugging), because my only other option is Windows 98 SE, which is not supported by the Visual C runtime libraries that Dwarf Fortress relies on.

 - Kal Zarius
Logged

icelus

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #3 on: April 03, 2009, 03:42:42 pm »

Same problem here (also on Ubuntu)

1ghz Athlon (thunderbird)
1Gib RAM

I do have a newer machine but the exe is linked against a _lot_ of new libraries (and we aren't all able to upgrade). Since backward compatibility is maintained, linking against old versions when releasing a binary might be a good idea (e.g. gtk/glib/pango/atk/glibc/cairo.... are all newer than my distro on my newer machine supplies). I wouldn't have thought from the screenshots you were making heavy use of any of these, so the version ought not to be too significant.
Logged

Kalzarius

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #4 on: April 03, 2009, 05:58:55 pm »

Yeah, mine too is an AMD Athlon Thunderbird, but I don't think it's a library issue.  If that were the case, I imagine it would either crash or fail to run due to a missing library (and say so).  "Illegal instruction", to my knowledge, means that the CPU got an instruction it can't run.  Therefore, it's probably an SSE issue, since AMD didn't start supporting SSE instructions until the Athlon XPs.  But then, it could be something else entirely that I haven't considered.

 - Kal Zarius
Logged

icelus

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #5 on: April 03, 2009, 06:16:54 pm »

I think you misunderstood. Sure it's a CPU issue on the athlon. The reason I can't use my P4 is the software stack is too new. Either different compiler flags (so I could play on the older machine with newer software) OR different linking (so I could play on the newer machine with older software) would let me play!
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: [40d] Illegal Instruction
« Reply #6 on: April 03, 2009, 06:55:22 pm »

It's possible that the newer versions of libraries give speed optimizations.  I guess it's not worthwhile to ask why you don't upgrade your libraries :)
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Kalzarius

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #7 on: April 03, 2009, 07:03:44 pm »

I think you misunderstood. Sure it's a CPU issue on the athlon. The reason I can't use my P4 is the software stack is too new. Either different compiler flags (so I could play on the older machine with newer software) OR different linking (so I could play on the newer machine with older software) would let me play!

Why yes, yes I did.

And indeed.  It's a pity Ubuntu isn't kept better up to date in terms of libraries.  Manually installing newer versions is neither easy nor stable.  You either end up with two different versions of a library, or you break something that also then has to be upgraded manually.  Ah, the glories of multiple Linux variants.  But that's off topic.

 - Kal Zarius
Logged

icelus

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #8 on: April 03, 2009, 07:18:08 pm »

It's possible that the newer versions of libraries give speed optimizations.  I guess it's not worthwhile to ask why you don't upgrade your libraries :)

What you link against under linux is not what you run against. It works like this: say you link against version 2.11 of libfoo. If you distribute that binary then (assuming the obvious like cpu architectures) anyone with 2.11 or greater can use the software. So if you only use features from say 2.1 and you link against 2.53 then people with versions 2.1<=x<2.53 miss out for no good reason. The same routines are called, it's just a question of who can run the software. Now sure you might have used some new features, and they might be more efficient than the old ones, but that's a different issue, and in that case there's not much you can do about it. For stuff like glibc though, it generally hasn't made much difference since the libc5 -> libc6 switch what version you used in terms of features.
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: [40d] Illegal Instruction
« Reply #9 on: April 04, 2009, 12:29:35 pm »

Umm, the game was written for Intel P3+ chips.
It's quite possible and probable that old AMD chips don't support the instructions.

..Beyond that, 900 mhz is not going to get you anywhere in DF anyway.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Kalzarius

  • Escaped Lunatic
    • View Profile
Re: [40d] Illegal Instruction
« Reply #10 on: April 04, 2009, 05:27:36 pm »

I never saw any mention of CPU requirements, just RAM and Operating System (Windows 98+), the latter of which, incidentally, is no longer accurate.

Typically, people don't code software for specific CPUs.  The use of SSE helps improve performance on newer CPUs.  The only reason for this sort of problem is either a broken library, or someone hand-coded the SSE optimizations in and did not include a check to make sure SSE was available first.

And to note, 900 MHz got me a nice sized fort on 40d.  It ran a little slow around 10 FPS in the later years, but it was still fun to play.
Logged