GPU Mathematica Guide

From Storrs HPC Wiki
Jump to: navigation, search

We have Mathematica working with CUDA, but the overall state of the software is a bit unstable.

The steps to follow are:

 module load cuda/4.0 mathematica/8.0.2.0

Then submit an interactive mathematica job to the scheduler with a GPU resource reservation.

$ fisbatch --gres=gpu:8 -n1
FISBATCH -- the maximum time for the interactive screen is limited to 6 hours. You can add QoS to overwrite it.
FISBATCH -- waiting for JOBID 20248 to start on cluster=cluster and partition=Westmere
.........!
FISBATCH -- Connecting to head node (cn42)
[xxx00000@cn42 ~]$ math
... # here will be the interactive commands with Mathematica
[xxx00000@cn42 ~]$ exit
[screen is terminating]
Connection to cn42 closed.
FISBATCH -- exiting job

NOTE: please DO NOT FORGET to EXIT from the nodes so that the other users can use it.

Once you are running mathematica, try the following steps:

 Mathematica 8.0 for Linux x86 (64-bit)
 Copyright 1988-2011 Wolfram Research, Inc.
 In[1]:= Needs["CUDALink`"]

 In[2]:= CUDAResourcesInstall["/apps/mathematica/8.0.2.0/paclets/CUDAResources-Lin64-8.0.2.1.paclet", Update->True]

 Out[2]= {Paclet[CUDAResources, 8.0.2.1, <>]}

 In[3]:= CUDAQ[]

 Out[3]= True


Unfortunately you need to run these steps every time you run Mathematica, and if you restart you need to either run CUDAResourcesUninstall or remove the entire ~/.Mathematica directory from your home folder.