Jump to content

32bit vrs 64bit???


Dimetime35c

Recommended Posts

Okay I'm kinda confused here. Why does everyone always ask about KSP upgrading to 64bit? What does that even mean??? I have very little programming knowledge so I don't really understand how that would help the game run better. Could someone explain what the difference would even be?

Link to comment
Share on other sites

what you need to know is 64 bit simply means the maximin ram goes from 4 GB to a number we won't ever reach till another few decades, even then only mega super computers.

also 64bit allows for greater math precision and will reduce rounding bugs.

Link to comment
Share on other sites

64 bit allows exobytes of RAM. However, 64-bit Windows is written such that it'll only allow 256TB of RAM to be addressed to reduce load. I don't believe this is a limitation on the AMD64 instruction set though, but a limitation to Windows itself. Granted my desktop only has 16GB of RAM and most seriously loaded enthusiasts machines and workstations might have 64GB (I am ignoring servers). At a likely rate of growth about roughly a doubling in RAM density every 2-3 years, we'll hit that cap on high end machines in about 20-30 years.

One perk though of 32-bit over 64-bit is that it allows larger registers to be used (how memory is addressed and instructions issued). There are some workloads that actually run slower with a larger register space, but those are few and far between. Most programs/parts of programs run faster with a larger register space.

The performance difference is usually pretty small, but we are talking generally in the realm of 3-10% is the typical speed up you can see from moving a program from 32-bit to 64-bit. So it isn't simply being able to address more memory, there are other benifits as well.

Also as Leax256 pointed out, 64 bit would allow greater math precision. This would likely be a case where performance would suffer, as it would create a greater workload for the processor. That said, you don't neccessarily have to go out to 64 bit precision on your math. You could always simply move to 40 bit precision or even 34 bit. 34 bit precision would get you numbers that are 4 times more accurate than they are currently, 40 bit would get you 256 times more accurate.

Link to comment
Share on other sites

64bit in laymans terms means the numbers used in calculations can be a lot bigger (good news for accuracy and rounding errors). Also the Register Addresses to store information in memory become a lot longer, hence the possibility to massively increase the RAM, which is very good news for the performance.

A system is 64bit when the processor and motherboard is 64bit (the connections between CPU, memory and board have 64 "channels" instead of 32)

Link to comment
Share on other sites

In simple terms...the game, currently is built in 32bit, and only allows up to 4 gb of ram to be used, (regardless of how much you have on your system), before it will crash and cease to operate. If the game were built in a 64 bit style, if you had 10 gb of ram, then you could use 10 gb of ram for the performance.

Disclaimer!!!! I am not a computer person! :confused:

Link to comment
Share on other sites

As you might know, a computer runs on binary. It counts using only 1's and 0's. So our 0 1 2 3 4 5 6 7 would be:

000

001

010

011

100

101

110

111

in binary. During counting above here I only used 3 symbols. So this was a 3 bit system. However, if I add another number it would become 1000, a 4 bit number. I can't fit a 4 bit number in a 3 bit system. This is essentially the problem computers have right now. When you try to access some data the computer needs to tell the memory where the data is. When you have a 32 bit system the computer can only point to about 4 billion places. So if you have any more the computer can't access it.

Kerbal Space Program uses a lot of memory (Especially when using mods). Not to mention physics calculations are faster and more accurate if you have more bits. At the moment KSP is programmed to act as if it runs on a 32 bit system (even if it isn't), so a lot of people would like to see an option to use 64 bits.

Link to comment
Share on other sites

Also as Leax256 pointed out, 64 bit would allow greater math precision. This would likely be a case where performance would suffer, as it would create a greater workload for the processor. That said, you don't neccessarily have to go out to 64 bit precision on your math. You could always simply move to 40 bit precision or even 34 bit. 34 bit precision would get you numbers that are 4 times more accurate than they are currently, 40 bit would get you 256 times more accurate.

This is how myths are born. It's simply flat out incorrect. There is absolutely no difference in precision between 32bit mode and 64bit - both of them can use single- of double- precision floating point numbers.

Link to comment
Share on other sites

This is how myths are born. It's simply flat out incorrect. There is absolutely no difference in precision between 32bit mode and 64bit - both of them can use single- of double- precision floating point numbers.

single precision 32bit:

10101010101010101010101010101010

single precision 64bit:

1010101010101010101010101010101010101010101010101010101010101010

so yeah. What was a double for 32bit is a single for 64bit which can lead to a speed up in code.

Link to comment
Share on other sites

hmm il be interested to know if the devs do plan on going to x64bit not for the game memory id like them to keep it under the 4GB default

but once released build a version in x64bit for us that have loads of ram and a really love our mods and i wouldnt mind paying a little extra for this version if they do decide to go with it as right now i have to pick and choose between mods due to ram limits within the game engine and once they add all the polishing eg graphical extras and new planets all the missions mining etc etc and so on that ram for mods is going to get less and less and every mod i have seems every update to them they add more and more which takes more ram

Edited by Bessy
Link to comment
Share on other sites

Every part on a spacecraft has an origin, an x-y-z position. This x-y-z position (along with rotation about these axis) are related to the origin of the spacecraft itself. At launch, these parts are all "next" to each other. As the spacecraft moves, the x-y-z and rotations of the individual parts are all constantly recalculated. Visually, the spacecraft appears to be a single mass.

However, as the craft proceeds into deep space at millions of kilometers from the launch site, the recalculated individual parts' x-y-z positions and rotations begin to "drift apart" (due to rounding errors). At some point, the spacecraft is no longer a single cohesive unit, and it explodes. This is the Kracken.

Squad worked around this problem. Instead of a single origin for the universe from which all x-y-z positions are related, the origin moves with the spacecraft. In effect, the visible spacecraft that you see on screen is the ORIGIN of the universe. All parts of the spacecraft relate to that origin. The planets, moons, other craft, buildings, etc. have their origins relate to the origin of the spacecraft (or EVA Kerbal). Thus, we are no longer dealing with astronomical distances, but relatively short distances which can be handled with 32-bit precision arithmetic.

If the Unity3D engine ever becomes a stable 64-bit, then the KSP universe can have a single universal origin. There is a 64-bit Unity engine, but it is highly unstable in Windows. All x-y-z positions and rotations calculations can be computed from that single point. The ability to go beyond 4 gigabytes of RAM would be a side benefit.

Felipe explains this far better than I during his Unite 2013 presentation. You may view that in my other thread, Building A New Universe.

Edited by Apollo13
Link to comment
Share on other sites

Unity support 64 bit programs, they made an 64 bit windows version of KSP however it was unstable and crashed for unknown reasons.

The mac and linux version of KSP runs 64 bit just nice.

I guess they don't focus on fixing the 64 bit problem as it can be hard and might go away if unity is updated or come back if in later versions of KSP.

As for 64 bit numbers, supported in both 64 and 32 bit windows but the 64 bit version is faster here.

Link to comment
Share on other sites

A couple things right now:

1. There is no difference between a "32bit double" and a "64bit double", the Double datatype is defined as 64 bit size (there is no 32bit double). A 64bit register machine can, however, compute that faster than a 32bit register machine. (That said, there is theoretically a "Quadruple" datatype that uses 128bit values and is therefore even more precise.)

2. The Unity engine is 64bit capable. From what we have head, the mere reason there is no 64bit build for Windows at this point is that it has shown to be horribly unstable on Windows. The Linux version (and therefore presumably also the MacOS version) has a reasonably working 64bit build. As for datatypes used, that's actually a slightly different point than merely a "64bit build".

Link to comment
Share on other sites

single precision 32bit:

10101010101010101010101010101010

single precision 64bit:

1010101010101010101010101010101010101010101010101010101010101010

so yeah. What was a double for 32bit is a single for 64bit which can lead to a speed up in code.

Single precision is always 32bits . If you're not convinced then you might want to try sizeof(float) in a 64bit machine, is 4 bytes long, ie, 32 bits.

Link to comment
Share on other sites

As you can tell from the various answers, the question has to be more specific in order to get an actual answer, as it can be applied to many things.

When most people talk about wanting a 64 bit version of KSP, they're referring to the instruction set, in this case the AMD64 instruction set which AMD created and Intel licensed. While there are possible efficiency improvements, the most noticeable change between AMD64 and the previous standard of x86 is that the former can address more than 4GB of RAM fairly easily.

On the other hand, 32 bit vs 64 bit can also refer to the size of data, where a 64 bit integer has much greater range, and a 64 bit floating point value has much more precision.

Link to comment
Share on other sites

I'm just wondering how both 32 and 64 bit actually work when applied to KSP. So 32 can only use 4GB of RAM where as 64 bit seems to have an unlimited RAM use. Why is that? What makes it different? Just someone that knows almost 0 when it comes to programming. I know hardware like CPU, RAM, Ect. I know how to build a PC but when it comes to the actual game programs I don't know much. All I know is more RAM = faster load times and more power.

Link to comment
Share on other sites

So 32 can only use 4GB of RAM where as 64 bit seems to have an unlimited RAM use. Why is that? What makes it different?

This was already answered, in very simplified terms;

A system is 64bit when the processor and motherboard is 64bit (the connections between CPU, memory and board have 64 "channels" instead of 32)

Link to comment
Share on other sites

A 64bit register machine can, however, compute that faster than a 32bit register machine.

Is this actually true? Floating point ops aren't done directly by the processor; they're offloaded to a hardware subroutine. No reason why you can't have a fast 64-bit floating point subroutine used by a 32-bit processor. The hang-up, I suppose, would be fetching and caching the values being worked on.

Link to comment
Share on other sites

single precision 32bit:

10101010101010101010101010101010

single precision 64bit:

1010101010101010101010101010101010101010101010101010101010101010

so yeah. What was a double for 32bit is a single for 64bit which can lead to a speed up in code.

That is the difference between single and double precision, not 32 and 64 bit processors/OS support.

There is a large performance penalty for doing double precision math versus single precision. On most CPUs you are talking around a 1.5x penalty in time required. GPUs are typically much, much worse as their SMIDs are designed for single precision operations. Most of the time a 1 teraflop GPU is looking more like 200 gigaflops when running double precision floating point numbers.

There is GENERALLY a performance increase to running in 64 bit mode versus 32 bit on modern processors though. There are more general purpose registers with 64 bit than 32 bit, double to be precise in x86-64 versus x86-32.

Don't believe me, Anand mentions it specifically in his review of the A7 SoC in the new iPhone 5s. You can find other sources that discuss it as well.

http://www.anandtech.com/show/7335/the-iphone-5s-review/4

http://en.wikipedia.org/wiki/X86-64

x86-32 has 8 registers of 32 bits in length, x86-64 has 16 registers of 64 bits in length.

This means you have twice as many registers that can be used, in addition for 64 bit integers and 64 bit floats (IE double precision) you no longer need to have it broken over two registers.

This is what leads to a vague 10% performance increase running 64-bit versus 32-bit. Obviously somethings won't run faster. Some things will run slower, but more things will run faster and by more than there are that run slower and by less.

That small a difference is generally called "bonus, but who's going to notice".

Edited by lazarus1024
Link to comment
Share on other sites

However, 64-bit Windows is written such that it'll only allow 256TB of RAM to be addressed to reduce load. I don't believe this is a limitation on the AMD64 instruction set though, but a limitation to Windows itself.

It is a limitation in AMD64/x86-64. While the pointers are 64bits wide the first chunk is required to be all zero or all 1s, otherwise the CPU will reject the pointer as a load/store address. See http://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details. Thats in the silicon. Now the instructions are perfectly forward compatible with silicon that would not reject such a pointer, but technically it is "in the instruction set" because its in the silicon. So currently AMD64 is only 48bits, the next implementation will make it 56 but it could be years and year and years before that is necessary.

Anyways to answer the original question 64bit is not needed or desired for KSP. At best it would allow you to load effectively unlimited plugins at startup, but that goal can also be reached by a number of other optimizations such as lazy loading parts, or just making the part loader more memory efficient. In fact its not even so much a memory efficiency issue as a memory fragmentation issue, but in any case its just not needed.

Link to comment
Share on other sites

1. There is no difference between a "32bit double" and a "64bit double", the Double datatype is defined as 64 bit size (there is no 32bit double).

That was true but this is false-ish:

A 64bit register machine can, however, compute that faster than a 32bit register machine. (That said, there is theoretically a "Quadruple" datatype that uses 128bit values and is therefore even more precise.)

Your Core i7 can run in 64bit or 32bit mode. It uses the exact same floating point unit to compute (double) x + (double) y. Same silicon, same clock, same speed.

There are things that can make 64bit mode faster than 32bit mode but they are additional instructions SIMD that allow certain vector computations to be done more quickly. While that would be helpful to KSP, but it would require that the compiler for Unity know when to emit those instructions. A good compiler can probably do this, but its not really anything squad can easily control.

Link to comment
Share on other sites

Anyways to answer the original question 64bit is not needed or desired for KSP. At best it would allow you to load effectively unlimited plugins at startup, but that goal can also be reached by a number of other optimizations such as lazy loading parts, or just making the part loader more memory efficient. In fact its not even so much a memory efficiency issue as a memory fragmentation issue, but in any case its just not needed.

The devs mentioned that Friday on their livestream, that they wanted people to focus on the problems, not what they saw as the easiest solution, because while a 64 bit client would ease memory problems for those players that had more than 4GB of ram and a 64-bit OS, it wouldn't help anyone that didn't have both, but memory optimizations within the game or engine would benefit everyone.

Link to comment
Share on other sites

Yes, I think they need to work on optimizing the game itself. The additional general registers and bigger ones that 64 bit operation allow might make zero performance difference to KSP. It certainly does in some applications.

It could also yield a slight performance benefit, but there is likely a lot more than a theoretical 10% gain to be had in optimizing KSP code to run 64-bit and a lot of work to allow KSP to run 64 bit, especially since Unity 64-bit support on Windows seems troubled at best right now.

One thing to keep in mind too, just like with KSP, there are a whole BOAT ton of programs that are 32-bit only. Its just relatively transparent that they are 32-bit. In fact I'd wager to say that MOST programs are 32-bit only still. Honestly, something Microsoft could consider doing that would benefit the programming and computer user community a lot is declare x86-32 dead and put a drop dead date on Windows x86-32 libraries, say 3-5 years out. It would likely reduce the install size of Windows by several gigabytes (at least), would likely lead to at least a hint of general speed up in Windows (certainly boot time as you don't have to load a lot of the 32-bit specific files) and it would also force programmers to code for just 64-bit knowing that down the road that would be the only choice.

MS could possibly add in a limited virtualization option to run 32-bit code after the drop dead date for old unsupported software, but just like DOS stuff, compatibility not guaranteed.

I am not saying 32-bit should be dropped tomorrow, but there are very few downsides to x86-64 over x86-32 and a heck of a lot more advantages, even if most of them are small advantages. Lets combine that with all of the inefficiencies built in to windows to support both x86-32 and x86-64 and it just makes sense to at SOME point, drop x86-32 support.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...