Installing CUDA Development Tools

The setup of CUDA development tools on a system running the appropriate version of Linux consists of a few simple steps:

Step 1: Verify You Have a Supported Version of Linux

The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes.

To determine which distribution and release number you're running, type the following at the command line:

uname -m && cat /etc/*release

You should see output similar to the following, modified for your particular system:

i386 Red Hat Enterprise Linux WS release 4 (Nahant Update 6)

The i386 line indicates you are running on a 32-bit system. On 64-bit systems running in 64-bit mode, this line will generally read: x86_64. The second line gives the version number of the operating system.

Step 2: Install the NVIDIA CUDA Toolkit

The CUDA Toolkit is part of the NVIDIA CodeWorks for Android installation.

Please refer to Download and Install CodeWorks for Android for details on installing the CUDA Toolkit.

Step 3: Verify the Installation

Before continuing, it is important to verify that the CUDA toolkit can find and communicate correctly with the cross compilers and that the CUDA-capable hardware has been updated with the correct OS image. To do this, you need to compile and run some of the included sample programs.

Make sure the Android NDK environment is set properly, inside Eclipse which was launched as the last step of installation, go to Windows > Preferences. Expand Android in the left pane of the dialog that appears and choose NDK. On the right pane, make sure that NDK location is set to ~/NVPACK/android-NDK-[version], click Apply and then OK.

Verify the OS image and drivers on the device

This can be done through your System Settings > About tablet > Build number. The build number should match the Android image installed by CodeWorks for Android.

Compiling the Examples

The version of the CUDA Toolkit can be checked by running nvcc -V in a terminal window. The nvcc command runs the compiler driver that compiles CUDA programs.

It calls the NDK gcc compiler for C code and the NVIDIA PTX compiler for the CUDA code.

The NVIDIA CUDA Toolkit includes sample programs in source form. You should compile them by choosing ~/NVPACK/cudasample_workspace as the workspace in the Eclipse that was installed in previous steps. The samples are already imported in this workspace.

On the command line, change directory to the cuda directory within the desired sample's directory. Run make. This will build the CUDA components in to a native library in the same directory.

In Eclipse, select and right-click on the desired sample's project, and select Build Project. This will build the APK for the project in to the bin directory within the sample's directory.

Running the Binaries

After successfully building the project, in Eclipse, right click the project and select Run As > Android Application.


Results of running the boxFilter sample

The exact appearance might be different on your system. The important outcome is that a blurred version of the Lena image is visible, which signifies both that the device was found, and that a CUDA application was successfully able to run.

 

 


NVIDIA® GameWorks™ Documentation Rev. 1.0.220830 ©2014-2022. NVIDIA Corporation and affiliates. All Rights Reserved.