Bioshock Infinite Workaround For Linux With AMD Processors

| Comments

I’m late to the “Bioshock Infinite is now available on Linux” party. I didn’t notice it until a few days ago when Steam popped up a message telling me that 2K Games was having a big sale. I looked at the list, and there was Bioshock Infinite. Not only was it available for Linux, but it was also 75% off. I decided to grab the “Season Pass Bundle” and give the game a try.

I had to wait almost an hour for the 42-GB game to download. Things went just fine for a while, but the game froze up on me before even getting out of the rowboat. I figured that it might have been a fluke, so I tried again. I believe I made it off the rowboat on my third attempt, but I didn’t get much farther than that.

I tried tweaking all sorts of things. One red herring I encountered was when I switched from my custom 3.19-pf2 kernel to the stock Ubuntu kernel. I probably played that time for nearly an hour. I made it far enough to pick up a gun, then the game froze up again. No matter what I did at this point, I was consistently freezing up near the start of the first gun battle.

When it freezes up like this, the video stops but the music just keeps on playing. I end up having to kill the bioshock.i386 process.

I asked Google, but Google didn’t know

The Internet wasn’t terribly insightful this time. I did get a small clue while browsing r/linuxgaming on Reddit. In the comments on one of the handful of Bioshock Infinite posts, there were three people with a similar problem replying to one another. They all had various multicore AMD processors. My FX-8350 is a Piledriver CPU, and I’ve found forum responses from people with Bulldozer and Phenom chips.

This was enough of a lead to help narrow my search considerably. I found a Steam forum post with a considerable number of people in the same boat. The consensus seemed to be that using taskset to limit Bioshock Infinite to fewer cores either completely works around the problem, or at least reduces the incidence of crashing quite significantly.

I tried using taskset to limit the game to just one core, but the intro videos couldn’t even play smoothly. I ended up limiting the game to two cores, and this seems to be working quite well. My frame rates are a little lower, but the game is definitely playable. I haven’t crashed again, but I haven’t played much more yet, either.

A better fix than taskset. I hope!

I installed the amd64-microcode Ubuntu package last night. This package puts CPU microcode patches into your initrd, and these are loaded into the CPU on boot. I was too busy to reboot last night, but I gave it a shot today. I rebooted, removed all the taskset nonsense from Bioshock Infinite’s launched options, and then played some Bioshock.

The game now runs better than ever. It feels smoother—enabling all eight cores made the game really choppy the last time I tried, and I was able to make it through two checkpoints without any problems. This seems like a much better fix than using taskset.

If you’re running Ubuntu or Debian, all you have to do is run the command sudo apt-get install amd64-microcode and then reboot. If you’re having trouble and using an Intel processor, there is also an intel-microcode package. Installing that and rebooting may be helpful, but I can’t test that.

I’ll keep playing, and I’ll report back here if this continues to be successful.

Update on the better fix

Updating the microcode is definitely working better than limiting the game to just two cores using taskset, but it isn’t perfect. The game froze up again after another hour or two of playing. This time, though, it froze up and wouldn’t come back. There were no NVRM errors this time, though!

I’m currently running with both the AMD microcode update installed, and with taskset -c 0,4 set in my launch options. I added the taskset back after freezing up several times in a row. and the game hasn’t frozen up since. We’ll see if the combination keeps working well. I’m not sure if taskset is helping, or if dumb luck was keeping it from locking up on me.

How to use taskset

Using taskset with a Steam game is pretty easy. Open up Steam, and find Bioshock Infinite in your list of games. Right click on Bioshock Infinite and choose “properties.” That will open another window which should contain a button labeled “Set launch options.”

tasket for Bioshock Infinite

When you click that button you will be presented with a small dialog box that contains a single text field. In that field enter taskset -c 0,1 %command%.

Update 1:

On my FX-8350, cores 0 and 1 are completely different cores. I’ve had more luck using a sibling cores instead with taskset -c 0,4. Cores 4 through 7 are siblings of cores 0 through 3. Sibling cores each have their own integer processing units, but they share a floating point unit and cache.

After upgrading to the new 349.12 beta Nvidia driver, I decided to take a shot at running Bioshock without using taskset to restrict it to two cores. It didn’t go very well. It froze up pretty quickly, and the mouse felt terrible again.

At this point, I can usually play for a couple of hours at a time without any problems. I’m usually the one that decides it is time to stop playing instead of the game deciding for me, which I think is a big improvement.

The game is still very fragile, though. I’ve noticed that if I “alt-tab” out of the game, it will very likely freeze up on my in the next minute or so. This isn’t as bad as the “multicore freeze.” The game will eventually start moving again, but it will keep freezing at regular intervals.

Unfortunately, the autosave points are way too far apart for this to be of any use.

Update 2:

Sometimes Bioshock Infinite for Linux runs great, and sometimes it doesn’t. Last night, things were going well for 15 minutes before it started freezing up every three or four minutes. This was the less catastrophic sort of freezing, and I was able to make my way to the next save point. I restarted the game several times, but the situation didn’t improve at all.

I figured that I’d have to reboot or restart my X server to improve the situation. I didn’t think it was worth that kind of effort, so I just played Team Fortress 2 instead.

I decided to fire up Bioshock Infinite again today, and I played for over an hour with no problems. There were no reboots involved. It just happened to work. I can’t tell you anything that was different. I didn’t imagine it could really be the problem, but I was even keeping an eye on CPU and GPU temperatures. The temperatures weren’t any higher

Errors to watch out for

When the game freezes up, there are usually some NVRM errors in the dmesg output. I don’t see these when I play any other game. I did see some similar errors in Borderlands 2 when using the first beta driver that supported my GTX 970 video card, though.

1
2
3
NVRM: Xid (PCI:0000:01:00): 69, Class Error: ChId 0004, Class 0000b197, Offset 00002044, Data 0000000f, ErrorCode 00000004
NVRM: Xid (PCI:0000:01:00): 31, Ch 0000002e, engmask 00000111, intr 10000000
NVRM: Xid (PCI:0000:01:00): 12, COCOD 00000026 beed9097 0000b197 00000e0c 0b970283

I did experience some particularly annoying NVRM errors with an Xid of 50. Every time one of these errors showed up in dmesg, the “performance level” of my GTX 970 would drop by one level.

1
2
NVRM: Xid (PCI:0000:01:00): 50,  L2 -> L1
NVRM: Xid (PCI:0000:01:00): 50,  L1 -> L0

The first time the error shows up, the “performance level” drops from 3 to 2. Once this happens, I didn’t see the “graphics clock” go above about 700 Mhz. If I kept playing in this crippled state, it would eventually drop to “performance level” 1.

I have not had this problem since using the taskset workaround.

Nvidia Control Panel Performance Level

Every time this happened, I had to reboot to get back to normal. Restarting the X server may be enough to correct the problem, but it doesn’t take much longer to just reboot.

Bioshock Infinite for Linux keeps a log file at ~/.local/share/irrationalgames/bioshockinfinite/eon.txt. Every time I freeze up, I’ll find a line in that log file that starts with “Skipping draw call,” and then a bunch of lines saying “Ignoring motion.”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[thread 00000001][I][12207]: Ignoring motion
[thread 00000024][W][13336]: Skipping draw call because the draw wouldn't have any effect on any render target, depth stencil or unordered access view, and no occlusion query is being performed.
[thread 00000004][W][20886]: eON_LoadLibraryEx() couldn't load 'atiadlxx.dll', returning NULL!
[thread 00000004][W][20886]: eON_LoadLibraryEx() couldn't load 'atiadlxy.dll', returning NULL!
[thread 00000004][W][20886]: eON_LoadLibraryEx() couldn't load 'atiadlxx.dll', returning NULL!
[thread 00000004][W][20886]: eON_LoadLibraryEx() couldn't load 'atiadlxy.dll', returning NULL!
[thread 00000001][I][21078]: Ignoring motion
[thread 00000001][I][21089]: Ignoring motion
[thread 00000001][I][21102]: Ignoring motion
[thread 00000001][I][21102]: Ignoring motion
[thread 00000001][I][21113]: Ignoring motion
[thread 00000001][I][21124]: Ignoring motion
[thread 00000001][I][21135]: Ignoring motion
[thread 00000001][I][21145]: Ignoring motion
[thread 00000001][I][21176]: Ignoring motion
[thread 00000001][I][21187]: Ignoring motion
[thread 00000001][I][21198]: Ignoring motion
[thread 00000001][I][21208]: Ignoring motion

How is the Bioshock Infinite port?

Aside from the crashing, it seems pretty good. The graphics look great, and my GTX 970 card seems to be able to maintain better than 90 frames per second at 2560x1440 with pretty reasonable settings. I’ll have to go back and tweak those settings now that the game isn’t freezing up on me constantly. I made lots of seemingly random changes just trying to make the game stable!

The controls feel absolutely awful. I seem to have the mouse sensitivity set to about the same speed as I am used to in Team Fortress 2, but it doesn’t feel smooth like Team Fortress 2. A small move of the mouse results in very jarring movements. Bioshock Infinite uses the same engine as Borderlands 2, and I didn’t have this problem there. Hopefully I can steal the relevant bits from my Borderlands configuration files to make myself feel more at home!

Improving the mouse situation

Bioshock Infinite seems to be a little fragile. My mouse didn’t feel smooth because I have the polling frequency set to 1000 Hz. Lowering it to 250 Hz has made a huge improvement. It doesn’t feel like Team Fortress 2, but it feels pretty good now.

I also pilfered my MouseSensitivity setting from my Borderlands 2 configuration files. The mouse sensitivity slider in Bioshock Infinite isn’t very granular. One tiny click of the slider makes my mouse either much too sensitive or not nearly sensitive enough. Copying the setting from another Unreal Engine 3 game neatly sidestepped this particular annoyance.

I hope this information helps you with your problems. If it does, I would definitely like to hear about it. If it doesn’t, I’d like to hear about that, too! Please feel free to leave a comment. Maybe I can try to point you in the right direction!

Comments