Michael Sproul

How to Partially Bypass Gurobi's Academic IP Validation

Written by Michael Sproul on April 29, 2014.

Gurobi is a fast parallel solver for linear programming problems.

This post describes how to obtain a Gurobi license file if you are already part of an academic institution. It does not provide instructions for “hacking” Gurobi, merely for making the activation process more flexible if you are a valid academic user. These instructions have been tested with Gurobi v5.

The Situation

You work at a university and you have a computer that you’d like to install Gurobi on. For silly technical reasons (proxies, dodgy DNS, no direct internet access) you are unable to activate Gurobi with the free academic key.

The Solution

The solution is to use another university computer that does have a direct connection.

By making an HTTP GET request with the right parameters, you can generate a valid license for any computer.

From the directly-connected university computer (or through a VPN), make the following request:

GET http://apps.gurobi.com/keyserver?id=<key>&hostname=<hostname>&hostid=<hostid>&username=<username>&os=<platform>&sockets=<sockets>&localdate=<date>

Where:

  • <key> is a valid academic key obtained freely from the Gurobi website.
  • <hostname> is the hostname of the computer you’d like to create a license for.
  • <hostid> is the last 4 bytes of your computer’s MAC address in hexadecimal notation (e.g 1a70acbe).
  • <username> is your user name on the computer for which you are requesting a license.
  • <platform> is a string used by Gurobi to identify the OS of your computer (e.g. linux64).
  • <sockets> is the number of network devices on the computer you are requesting a license for.
  • <date> is today’s date in YYYY-MM-DD notation.

You can automatically generate most of these parameters by running grbprobe on your computer (it comes with Gurobi, inside the bin directory).

The probe won’t do sockets though, so you’re best off running strace to see how many sockets Gurobi thinks your computer has:

$ strace -f -e trace=network -s 10000 ./grbgetkey nonsense

Oddly, loopback devices seem to be excluded from the count used in the GET request parameter, but included in the license files count. Weird.

If you don’t fancy running strace, you could try running ifconfig and counting the number of network devices manually, but remember not to include loopback devices.

To make the actual GET request you can use anything you like (including a browser). I just used wget because it’s simple and can be run easily via ssh.

$ wget <url from above>

I hope these instructions make it a little easier for you to try Gurobi. I came up with them out of necessity when the uni network administrator suggested buying Gurobi full price instead of fixing the network topology!


Tagged: security, algorithms