Sid Meier's Civilization V

Sid Meier's Civilization V

View Stats:
jqpdev Feb 22, 2018 @ 6:19pm
New patch needed to fix segfaults in Civ 5 Linux client for CPUs with more than 8 logical cores
Hello all,

Aspyr needs to release a patch to the Civ 5 Linux client. The game client encounters segfaults when run on CPUs with greater than 8 logical cores such as the Ryzen 7 which has 8 cores / 16 threads. The game and the OS sees 16 CPUs. The segfaults affect Ubuntu and non-Ubuntu users (I'm on Manjaro Linux v17.1.5). I didn't determine this on my own. Other Linux users in the Steam community discovered this:
https://steamcommunity.com/app/8930/discussions/1/38596747621681086/

CPUs affected:
- Ryzen 5 1600/1600 Pro/1600X
- Ryzen 7 (all)
- Ryzen Threadripper (all)
- Intel core i7-8700/8700K (Coffee Lake)

Some Ryzen APUs (CPUs with on-chip graphics) will be affected as well.

For now we have a temporary workaround. From the thread linked above, in post#16, "eternalnoobage" came up with a command string to limit the number of CPUs the Linux client runs on:
taskset -c 1-8 steam steam://rungameid/8930

However, since the taskset command references CPUs starting at zero the command string should be altered to limit the game to CPUs 0-7.
taskset -c 0-7 steam steam://rungameid/8930

To check for segfaults, one needs only to open a terminal and run "dmesg", and examine the output. The grep command can be used to filter the output. The segfault entries will look like the following:
[] Civ5XP[1667]: segfault at 14 ip 000000000885bd5f sp 000000007f5e50c0 error 4 in Civ5XP[8048000+22a7000]

Since Aspyr handled the Linux and Mac ports of the game, it is possible that the Mac client may have trouble if run on CPUs with greater than 8 logical cores. I don't have a means of testing this since I don't have a Mac and I don't run a Hackintosh setup. The Civ 5 Windows client is unaffected by this bug. I had to temporarily install Win 10 to test.

I placed the adjusted command string into the icon on my KDE desktop. I ran a test match in game with all DLCs enabled and all mods disabled. I have all the DLCs and expansions purchased. The match settings were:
- 8 Civs / 16 City States
- Randomly selected Civ
- All A.I. Civs are random
- Random Map
- Standard size
- Chieftain difficulty
- Quick game pace
- Ancient Era start
- All victory types are enabled
- Policy saving, promotion saving, and start bias disabled checked, all other boxes are unchecked

I played for 3+ hours (more than 100 turns) without any errors. I purposefully dragged the game along by not playing with a proper focused strategy. I also took breaks and locked the desktop multiple times.

Anyone running the Civ 6 Linux client, on the above listed CPUs, and encountering random crashes or the game randomly aborting?
< >
Showing 1-15 of 31 comments
ともだち Feb 23, 2018 @ 10:15am 
I must admit I haven't used Linux in a good while, but I haven't found any issues on the Windows version using a 36-thread CPU. I honestly find it rather odd that such a problem exists because CPUs with more than 8 threads are not exactly news - you could have 12-thread CPUs 8 years ago when the i7-980X came out and 16-thread CPUs are readily available in the consumer space since the 5960X came out 4 years ago (little earlier if you account for the SB/IB Xeons).

Could it be an incompatibility with a newer kernel? Must say i'm intrigued with the issue.
Last edited by ともだち; Feb 23, 2018 @ 10:16am
jqpdev Feb 23, 2018 @ 12:21pm 
@[ZM]Dr. Dro:
Most consumers and especially the mainstream budget gamers are not going to be purchasing core i7-980X (6/12 cores/threads) CPUs when the MSRP is $999 US (wikipedia) and $1059 US (Intel). To be clear the core i7-980X and the i7-5960X CPUs are Core i7 Extreme branded CPUs. These are high end enthusiast CPUs that are generally out of the price range of most gaming oriented consumers, which would account for low number of users with those CPU types.

As stated in my original post, I installed Win 10 to test on my Ryzen 7 1700X system. There were no errors or crashes in Win 10. The difference is Aspyr is the company that is responsible for the code base on Linux. They handled the porting effort, where as the Windows version of the game was handled by 2k Games/Firaxis. We don't have feature parity between the Windows and Linux versions of the game so it is quite possible that there is something amiss with the Linux code base. If you want to see a difference in feature parity load the game on Windows and examine the options in Video Settings and then do the same on Linux.

Even if there is a issue between kernel versions, Aspyr is resistant to investigating the issue unless one is running the game on Steam OS or Ubuntu 16.04. Trying to lock users to a very specific release of Ubuntu is bound to create contention and give the impression that they will use any excuse to not provide support. I mean it would be beyond crazy to have a situation where I could play 12 different Steam games on my chosen distro of Linux but then I have to keep and maintain an Ubuntu 16.04 installation just to play Civ 5. Worse still is if I need to change to an "unsupported" kernel on Ubuntu for security reasons or compatibility with microcode changes from my CPU manufacturer, I'm likely to run into resistance from Aspyr if bugs/crashes are encountered.

I do not use Ubuntu because:
- Canonical does not respect user privacy (they put spyware in their distro)
- I detest the ugly look of the Unity desktop environment

I do not use Win 10 because:
- Microsoft does not respect user privacy (Win 10 is spyware masquerading as an OS)
- I detest the ugly look of Windows 10

The Windows 10 install that was used for testing only lasted long enough for me to determine if there was any issue on that platform given my hardware. The partition has been wiped and I've already re-installed Manjaro in its place. This is a time consuming effort and I'm not being compensated for my time. I just want to enjoy the game I paid for without jumping through unnecessary hoops.

Also, if the Aspyr guys looked at the thread I linked, in post #18 a user on the same Ryzen platform running Ubuntu 16.04 was having crashes.
Last edited by jqpdev; Feb 23, 2018 @ 12:45pm
ともだち Feb 23, 2018 @ 1:14pm 
While it's true most people don't, but some will, and given the target demographic, it's very likely that someone with such computer would have run this game on such hardware. I personally had an i7-990X back in 2011, for example. 8C/16T went mainstream last year, imho... and now us owners of workstation-class and/or extreme tier CPUs have 18C/36T CPUs (I do) so looking at the issue is definitely warranted.

I disagree about Windows 10 being spyware, telemetry is fully configurable and personally I have completely disabled it, which is no big deal to me, and it makes no sense why would anyone, particularly game developers be willing to isolate users of certain distros from running their game. It's really more of an obscure compatibility issue than anything else imo... have you tried running it on Mint? Although, Mint is Ubuntu in a way, any bug hitting Ubuntu would probably hit Mint just as hard.
jqpdev Feb 23, 2018 @ 2:52pm 
No I haven't tested on Mint. The guy in post #18 of the article I linked says he is on Ryzen 7 with Ubuntu 16.04.

On a side note:
Windows 10's telemetry is only partially configurable unless one is very adept at registry hacks, has an in-depth understanding of undocumented registry entries, or uses 3rd party undocumented apps. The Win 10 UI only allows one to partially opt-out of the data collection and casual use of the various OS features/apps leaks data back to MS and their business partners. Also, let's not forget the keylogging service that is enabled by default. You are welcome to disagree with me, but you have MS to thank for making it very difficult to refute my statements.
ともだち Feb 23, 2018 @ 3:36pm 
Which I do... although it's not like you need to, simple powershell script can be used to extensively disable all telemetry features... and like I said, if it happens on Ubuntu it's 99,9% likely the same issue remains on Mint.
Last edited by ともだち; Feb 23, 2018 @ 3:36pm
jqpdev Feb 23, 2018 @ 5:29pm 
Post a link to the P-shell script.
Damsteri Feb 24, 2018 @ 4:06am 
i7 980X owner here (now retired in behalf of i7 8700K). Windows version of Civ V works perfectly with 6C/12T CPU's and have always been working (but not getting any benefit from extra cores). Almost all of my +7000h is played with a 6C/12T CPU, so Win7/Win10 is definately clear of this problem and it's solely a problem of Aspyr's Mac/Linux port.
Last edited by Damsteri; Feb 24, 2018 @ 4:35am
ともだち Feb 24, 2018 @ 9:35am 
Originally posted by Damsteri:
i7 980X owner here (now retired in behalf of i7 8700K). Windows version of Civ V works perfectly with 6C/12T CPU's and have always been working (but not getting any benefit from extra cores). Almost all of my +7000h is played with a 6C/12T CPU, so Win7/Win10 is definately clear of this problem and it's solely a problem of Aspyr's Mac/Linux port.

Aye, same on my Xeon E5-4669 v3, which is quite an unusual processor. The i9-7980XE should behave quite similarly. But I have some trivia for you, so you can be even more proud that you've put so much time playing this on ye olde 980X ;)

Civ V was one of the first, if not the only game for a pretty good while that did take advantage of the Gulftown processor's 12 threads from the start, in fact it was used as the showcase for DirectX 11 deferred contexts and command lists, the latter of which AMD still doesn't support on their modern day Radeons, resorting to game-specific hacks and "enables", which was the case here.

https://forums.guru3d.com/threads/high-dx11-cpu-overhead-very-low-performance.398858/

You'd think years after getting exposed for their laziness the overall state of the graphics drivers would have changed, but they opted to just mask that with adding more "features" (like video recording) instead.
Last edited by ともだち; Feb 24, 2018 @ 9:39am
Damsteri Feb 24, 2018 @ 10:18am 
Actually I did test how multiple cores and hyperthreading affects Civ V's loading times, for both the game itself and for loading a save file. Test can be found here: http://steamcommunity.com/app/8930/discussions/0/458604254428877171/

I didn't test game much on other aspect than loading times. I didn't find a good way to add a table for discussions, so it's text only. Civ V didn't benefit extra cores much and HT actually slows down loading. CPU clock speed was more important than amount of cores.

Test was run on my old i7 980X (used it normally at 4.6GHz on water). It surely was nice CPU, was my main computer's CPU for over 7 years (May 2010 to Oct 2017), se total €/year was not that bad after all.
Last edited by Damsteri; Feb 24, 2018 @ 10:21am
jqpdev Feb 24, 2018 @ 5:13pm 
Any of you guys run the game on Ubuntu or any other distro of Linux?
jqpdev Mar 18, 2018 @ 2:44pm 
The following is from Linux Mint 18.3 64-bit Cinnamon Edition (Ubuntu derivative based on Ubuntu LTS).

Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected

Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 7 1700X Eight-Core Processor
CPU Family: 0x17
CPU Model: 0x1
CPU Stepping: 0x1
CPU Type: 0x0
Speed: 3800 Mhz
16 logical processors
8 physical processors
HyperThreading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
SSE4a: Supported
SSE41: Supported
SSE42: Supported
AES: Supported
AVX: Supported
CMPXCHG16B: Supported
LAHF/SAHF: Supported
PrefetchW: Unsupported

Operating System Version:
Linux Mint 18.3 Sylvia (64 bit)
Kernel Name: Linux
Kernel Version: 4.13.0-37-generic
X Server Vendor: The X.Org Foundation
X Server Release: 11804000
X Window Manager: Mutter (Muffin)
Steam Runtime Version: steam-runtime-beta-release_2017-10-05

Video Card:
Driver: NVIDIA Corporation GeForce GTX 1060 6GB/PCIe/SSE2
Driver Version: 4.5.0 NVIDIA 384.111
OpenGL Version: 4.5
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 119 Hz
VendorID: 0x10de
DeviceID: 0x1c03
Revision Not Detected
Number of Monitors: 1
Number of Logical Video Cards: 1
Primary Display Resolution: 1920 x 1080
Desktop Resolution: 1920 x 1080
Primary Display Size: 20.91" x 11.77" (23.98" diag)
53.1cm x 29.9cm (60.9cm diag)
Primary Bus: PCI Express 16x
Primary VRAM: 6144 MB
Supported MSAA Modes: 2x 4x 8x 16x

Sound card:
Audio device: Nvidia GPU 84 HDMI/DP

Memory:
RAM: 16032 Mb

Miscellaneous:
UI Language: English
LANG: en_US.UTF-8
Total Hard Disk Space Available: 98301 Mb
Largest Free Hard Disk Block: 61233 Mb
VR Headset: None detected

Recent Failure Reports:
jqpdev Mar 18, 2018 @ 2:45pm 
Here are segfaults from dmesg:

[] Civ5XP[13446]: segfault at 14 ip 000000000885bd5f sp 00000000e217d090 error 4 in Civ5XP[8048000+22a7000]
[] Civ5XP[13496]: segfault at 14 ip 000000000885bca7 sp 000000006a9b30a0 error 4 in Civ5XP[8048000+22a7000]
[] Civ5XP[13497]: segfault at 14 ip 000000000885bca7 sp 00000000697ff0a0 error 4 in Civ5XP[8048000+22a7000]

Again the issue is not limited to Manjaro and would affect the various Ubuntu based distros.
ger Mar 21, 2018 @ 1:48pm 
17.10 Kubuntu

taskset -c 0-7 steam steam://rungameid/8930

works for me.

[edit] 1700 & 480
Last edited by ger; Mar 21, 2018 @ 1:49pm
ger Mar 22, 2018 @ 10:05am 
ryzen 1700 ubuntu 17.10 working launch command

taskset -c 0-7 %command%
< >
Showing 1-15 of 31 comments
Per page: 15 30 50

Date Posted: Feb 22, 2018 @ 6:19pm
Posts: 31