Running Unity games via Steam in Linux

There seems to be a lot of confusion about how to run games built on the Unity engine distributed by Steam on a Linux system. I recently solved this problem after backing the promising survival sandbox game Planet Nomads on Kickstarter. Here is how to configure an Ubuntu Linux system and launch Planet Nomads successfully.

Prerequisites

If you have an Nvidia card, you must download and install the official proprietary drivers provided by Nvidia. I could not get Unity to launch with the open-source drivers. Once I installed the proprietary (closed source) drivers, I was able to launch Planet Nomads from the Steam application.

Launching on Linux

When you need to troubleshoot something, there is no substitute for using the command line. At this point, forget about Steam altogether. Open a terminal and run the following command. Once you get it working, you can create a “launcher” or shortcut in your desktop environment so that you won’t have to remember the command. It also may run directly from Steam once you’ve solved the underlying problem.

Open a terminal and type the following command to launch Planet Nomads. For other games build on Unity and distributed using Steam, use a similar command, but change the command to reflect the actual path to the game binary:

~/.steam/steam/steamapps/common/Planet\ Nomads/PlanetNomads.x86_64

I’m assuming you are already familiar with running commands in a terminal. If this Unix/Bash syntax is confusing, please post a comment and I will explain.

When the game launches successfully, the output looks like this:

Found path: /home/your_username/.steam/steam/steamapps/common/Planet Nomads/PlanetNomads.x86_64
Mono path[0] = '/home/your_username/.steam/steam/steamapps/common/Planet Nomads/PlanetNomads_Data/Managed'
Mono path[1] = '/home/your_username/.steam/steam/steamapps/common/Planet Nomads/PlanetNomads_Data/Mono'
Mono config path = '/home/your_username/.steam/steam/steamapps/common/Planet Nomads/PlanetNomads_Data/Mono/etc'
displaymanager : xrandr version warning. 1.5
client has 4 screens
displaymanager screen (0)(DVI-D-0): 1920 x 1080
Using libudev for joystick management

Importing game controller configs

Troubleshooting

You can specify a log file to hold full output from the game launch:

~/.steam/steam/steamapps/common/Planet\ Nomads/PlanetNomads.x86_64 -logfile ~/planetnomads_log.txt

Note that even a successful launch of the game will create some misleading errors in the log, such as:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Database.SQLite.Finalize () [0x00000] in :0 
[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.
 
(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

Note that these “error” messages do not impact your ability to play the game!

Advertisements

Audit terminology: SAS 70, SSAE 16, SSAE 18, SOC1, SOC2, Type 1, Type 2

If you are involved in information technology and compliance in a heavily regulated industry,  or work with larger organizations, you have probably run across the terms SAS 70, SSAE 16, SSAE 18, SOC 1 report, SOC 2 report, Type 1 Report, and Type 2 Report. These terms are frequently abused and misunderstood, even by compliance “experts,” so I’ve written this brief one-page summary. Everything I state below has a direct reference on the AICPA site; I have learned not to trust third-party sources in regards to compliance. Continue reading Audit terminology: SAS 70, SSAE 16, SSAE 18, SOC1, SOC2, Type 1, Type 2

Configure CentOS/RedHat VMs with Kickstart files on Virtualbox

Kickstart is a type of file that’s used to automatically install RedHat or CentOS Linux on a physical or virtual server. If you are managing more than a few servers, it’s a good idea to configure the servers via kickstart files instead of logging in and configuring each one manually. However, some unfortunate choices were made when defining the Kickstart file format, and it’s not the easiest thing to use. When creating a new Kickstart or making major changes, it’s good to have way to quickly iterate and test your changes. Iterating on a Kickstart file is slow and inconvenient in an enterprise environment in which a freshly booted server obtains an image and Kickstarter file via PXEboot. To speed up Kickstart testing and debugging, I’ve developed a simple way to use Kickstart files with CentOS/RedHat guest virtual machines that run in VirtualBox on my Mac. This process should also work with Windows or Linux hosts.

Continue reading Configure CentOS/RedHat VMs with Kickstart files on Virtualbox

General error: 2006 MySQL server has gone away

“MySQL Server has gone away” is a cryptic error that can be hard to troubleshoot (look at all the various responses on Stack Overflow!) Many problems can cause this error; I would like to document one specific case. In this example, the client is a PHP app using the Phalcon framework:

[Mon, 09 Apr 18 03:34:08 -0400][ERROR]  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /path/to/ModelBase.php:
Stack trace:
#0 [internal function]: PDOStatement->execute()
...
#17 {main}

Continue reading General error: 2006 MySQL server has gone away

Viewing logs for a cluster of instances on Google Stackdriver Logging

StackDriver Logging is a great feature of Google Compute Engine (GCE). You pretty much need a centralized logging solution if you are taking maximum advantage of the features offered by GCE. For example, most production applications will run on a cluster of web servers. If you set up the cluster as a managed instance group on GCE, Google can auto-scale the size of the cluster based on traffic. The challenge is that it’s much  harder to troubleshoot errors across a cluster. The requests that caused the error could be spread across any number of servers, with randomly assigned names. If load drops and the server pool contracts, you will entirely lose any log data on a server that’s auto-deleted. StackDriver Logging is the answer to this problem. Configure all servers to send all logs to StackDriver, and you can view all of your web server logs in one interface, with the entries in chronological order.

View StackDriver Advanced Filter as a Gist on GitHub

Continue reading Viewing logs for a cluster of instances on Google Stackdriver Logging

Getting DSSP to run with GROMACS 4.5.5 on Red Hat Linux

UPDATE

A new version of GROMACS (4.6 series) has been released since this post was written. Please try installing the latest version of GROMACS before attempting the steps in this post.

Fixing GROMACS

There is a bug in the do_dssp command in GROMACS 4.5.5 that prevents the analysis of secondary structure using DSSP . Attempting to run do_dssp will result in a segmentation fault. The bug has been patched since 4.5.5, but this version has not been released (see this post on the GROMACS mailing list). To get the patched version, follow the instructions from this post.

git clone git://git.gromacs.org/gromacs.git
git checkout --track -b release-4-5-patches origin/release-4-5-patches

Continue reading Getting DSSP to run with GROMACS 4.5.5 on Red Hat Linux

Mini Maker Faire Orlando Report: Electronics

In my previous post about the Mini Maker Faire Orlando, I described some of the cool hardware that was on display.  In this post, I’m going to describe some of the electronics available from local vendors.

Electrimod

Electrimod MiniStack
Electrimod MiniStack

Local vendor Electrimod (Clermont, FL) was on hand to showcase their pluggable modules for PIC microcontroller development.  Basically, Electrimod is developing products that are equivalent to Arduino shields.  You start with the PIC module, and then plug in whatever other modules you need to build your prototype in the form of a stack.

These brand-new products aren’t available yet, but they should be shipping by June or July 2012.

Continue reading Mini Maker Faire Orlando Report: Electronics

TeXLive and Asymptote on CentOS 5

Tex Live

For reasons unknown, a TeX Live package is not available for Red Hat Enterprise Linux/Centos 5 from the major repositories (EPEL or DAG).  I consider this to be a glaring omission, since TeXLive is a great improvement upon teTeX.  Since I don’t have time right now to package it myself, I installed TeX Live manually in my user directory and it’s working fine.  I used the network install process, which starts with downloading a command-line installer and then following the detailed installation instructions with the base path set to $HOME/texlive/2011.

Asymptote

The binary version of Asymptote installed with TeX Live didn’t run on my system, so I installed the Asymptote vector graphics language manually.  As root, I used yum to install the gc and gc-devel packages to provide the Boehm garbage collector that Asymptote uses.  I also had to install the package texinfo-tex from the CentOS base repo to provide the texindex utility that Asymptote uses to build its documentation.  Once the dependencies were in place, I downloaded the Asymptote source archive and unpacked it.  I used the following commands to build Asymptote in my user directory:

./configure --prefix=$HOME/asymptote
make
make install

Finally, I set up up the path environment variable in my .bashrc so that the copy of Asymptote I just built will run instead of the binary that comes with TeX Live and my locally installed TeX Live will run instead of the system installation of teTeX:

export PATH=~/asymptote/bin:~/texlive/2011/bin/x86_64-linux:$PATH

If you are doing this from scratch, you should check whether there is a away to prevent the TeX Live installer from installing Asymptote.

Technically, I could remove the system installation of teTeX at this point, but the LyX package depends on teTeX and I’ll have to see if there’s a way to tell yum to keep LyX and get rid of teTeX.

How to install Octave video tools on CentOS 5

This post describes how to get GNU Octave up and running on a CentOS 5 Linux system for use in reading, processing, and writing video files.  You will need to use the EPEL and DAG/rpmforge repositories, but I won’t explain how to do that here.

NOTE: I had to go through some trial and error to get this working.  I tried to summarize only the necessary steps, but I can’t guarantee I got it completely right until I try a fresh install on another system which does not have any of the dependencies already installed.  Please leave a comment if you encounter any problems.

As a superuser, use yum to install octave.  You need octave-devel and ncurses-devel in order to install any Octave packages.  You will need to have the EPEL repository enabled:

yum install octave octave-devel ncurses-devel

As a superuser, use yum to install ffmpeg and ffmpeg-devel from the rpmforge repo.  The video package for octave uses the ffmpeg libraries (avilib) to perform the actual video processing.  You will need the ffmpeg-devel package, because Octave builds the video package from source.

  1. Since ffmpeg and ffmpeg-devel are only available from DAG/rpmforge, I suggest disabling EPEL before installing these packages.  This will ensure that all the dependencies are installed from rpmforge, instead of mixing packages from EPEL and rpmforge.  Mixing dependencies from different repositories might lead to incompatibilities and bugs that can be hard to trace.
  2. yum install ffmpeg ffmpeg-devel

Install the video package for Octave.  I prefer to do this as an ordinary user (not root) so that the packages will be installed in my home directory (I have a “rule” that only the package manager is allowed to put files into system locations).  You will need to set the CXX flags environment variable to work around a bug in the C++ headers for the ffmpeg libraries.  If you are going to build other packages that link to ffmpeg’s libraries, you should probably set CXXFLAGS in your .bashrc.  I think this bug was fixed in later versions of ffmpeg, but they haven’t made it into EPEL or rpmforge yet.

  1. Download video package
  2. Unpack the archive: tar xfz video-1.0.2.tar.gz
  3. Change to the unpacked directory: cd video-1.0.2
  4. Temporarily set C++ flags and configure: CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure
  5. Temporarily set C++ flags and build: CXXFLAGS=-D__STDC_CONSTANT_MACROS make
  6. Install: make install

If you don’t set the C++ flags this way, you will get an error like this:

/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/include/libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope

Moving example code to GitHub

As this site has grown, the example code has gradually become unmanageable. I’ve posted snippets and fragments here and there over the years, and the original code is scattered in various locations across several computers. Further, as people have pointed out bugs or ways to improve the examples, I’ve had a hard time making changes. This is problem is crying out for version control with a central repository. Since I’ve been using Git for the past year or so, I decided to try GitHub. So, I am gradually moving all the examples from the site to:

https://github.com/cfinch/Shocksolution_Examples

When I put code in a post, I will provide a link to GitHub where you can browse or download the code.  You won’ t need to use Git, or even learn anything about it.