|Core Setup and Testing||Nondefault Installation|
|Further Setup and Configuration||Common Errors|
|Updating CUDA Resources|
CUDALink is designed to work automatically after Mathematica is installed, with no special configuration. You can test this by using the CUDAQ function.
This checks if CUDALink is supported. If it returns True, as shown below, then CUDALink will work.
If CUDAQ does not return True, CUDALink will not work. However, you might be able to configure your machine to fix this. The rest of this section describes steps you can carry out to try and enable CUDALink.
You should first confirm that you have GPU hardware supported by CUDA. If you are not certain, you can see the list of hardware supported in the "GPU Hardware" section. In addition, you should check that your operating system is supported.
For CUDALink to work, you need to have an up-to-date driver. You can check this for your system by running CUDADriverVersion.
CUDADriverVersion returns information on the CUDA driver version.
On Windows, the driver version needs to be at least 301.32 for CUDALink to work. On Mac OS X, the driver version needs to be at least 4.2.10. And on Linux, the driver version needs to be at least 295.41. If your driver is not up to date, you may be able to update it from the NVIDIA Drivers website.
In addition, you can check the driver information directly from your computer, as described in "Checking the NVIDIA Driver".
CUDALink automatically downloads and installs some of its functionality when you first use a CUDALink function such as CUDAQ. In fact, you may see information about the download of the resources (which are about 80 MB in size).
Under certain circumstances—for example, if you are not connected to the internet or have disabled Mathematica's internet access—the download will not work. You can test whether the resources have been installed by using CUDAResourcesInformation.
If your internet connectivity has been restored, you can use CUDAResourcesInstall, as shown below, to download and install the CUDALink resources.
Alternatively, you may install the resources manually. You can download the resources from the Wolfram Research website at the Wolfram CUDA Resources web page, taking the current file for your machine.
When you have downloaded the resources, you can install them in Mathematica with CUDAResourcesInstall, using the path to the download file.
After this, you should be able to execute CUDAResourcesInformation and see the installation.
You can confirm that CUDALink is working by executing CUDAQ and seeing that this returns True. However, some further configuration and testing may be useful, in particular if you want to use CUDAFunctionLoad.
More detailed information on your hardware is available from the Links section of SystemInformation. A sample is shown below.
This gives detailed information about your hardware. For example, you can tell how many cores are available and if double-precision computations are supported. You can also see how many CUDA devices you have installed on your machine and which is the fastest.
CUDALink automatically downloads and installs some of its functionality when you first use a CUDALink function such as CUDAQ. In fact, you may see information about the download of the resources (which are about 100 MB in size). You can see how to test and run the installation in the section on "CUDA Resources".
In addition, you can check the site at the Wolfram CUDA Resources web page to see if a new version is available.
CUDALink performs many system checks, testing to see if it is supported. The NVIDIA driver library, NVIDIA driver version, CUDA library path, CUDA library version, and the ability to load the CUDALink runtime libraries are checked before a function such as CUDAQ is called. If any fail, either because the file does not exist in the expected location or because the file is not of a supported version, then an error message is returned, and CUDAQ fails.
By default, CUDALink uses special locations where the installation has taken place. However, you can set system environment variables to choose different locations. More often than not, if the system has a CUDA-capable card and the proper software is installed, then you may have installed the driver in a nonstandard location. The following section details the environment variables checked.
This is the absolute path to the NVIDIA driver library. The library is installed by the NVIDIA driver package downloaded from the NVIDIA driver download website.
This is the absolute path to the CUDA library. The library is installed by the NVIDIA driver package downloaded from the NVIDIA driver download website.
On some systems, the configuration limits the number of seconds you can run a GPU computation before the operating system terminates the computation. On Windows Vista and 7, the timeout is set to two seconds by default.
Windows users can get this when computation takes more than two seconds on the GPU. Users can disable this behavior by following the Microsoft WDDM guide.
For CUDALink, a forced termination of graphics computation is equivalent to a crash. CUDALink will thus consider the current state of the GPU to be invalid, and only a Mathematica kernel restart will reset the state.
CUDALink requires a supported C compiler to be installed on the system. Supported C compilers are Microsoft Visual Studio 2005, 2008, and 2010 on Windows, GCC 4.4 or 4.5 on most Linux distributions, and 4.2.1 on Mac OS X. Mac OS X users can get the compiler from the OS X development package (which includes other tools like XCode).
If the compiler is not in a standard installation, then the "CompilerInstallation" option can be given to use the nondefault installation.
If the compiler is not in a standard installation, then the "CompilerIntallation" option can be given to use the nondefault installation, as described in "Setting a Different Compiler" .
On systems with multiple GPU devices, the NVIDIA driver must be installed last. This will allow the operating system to run the CUDA card using the proper driver. Note that some operating systems, such as Windows Vista, do not allow users to run two video cards from different manufacturers.
Laptops that perform automatic video card switching (between an Intel and an NVIDIA card, for example) may interfere with CUDALink's initialization of the CUDA device. On such systems, users can either disable the video card switching behavior, or use tools that allow the user to switch from the menu bar (search the web for "dual-GPU switch" followed by the operating system).
A recommended alternative to VNC is to set up remote kernels. This allows you to get the interactivity of the front end while running the kernel on a remote CUDA machine. Information on how to set up remote kernels is found in the
Most virtual machines emulate the video card, so you cannot access the GPU for CUDA computation. Unless your virtual machine software supports GPU computation, and the machine is configured to allow the virtual machine to use the GPU, CUDALink is not supported in a virtual machine.
CUDALink is supported on multiple devices using Mathematica's parallel tools. Worker kernels can be launched for each GPU. The maximum number of GPUs supported is limited only by the number of kernels a user can launch.
CUDALink is supported on headless terminals, although sometimes on Linux, due to system configuration, the NVIDIA devices do not get the proper permission. For more information on configuring CUDALink for use on headless terminals, refer to