Welcome to the Accelerated Computing Teaching Kit Lab/solution repository. The kit and associated labs are produced jointly by NVIDIA and University of Illinois (UIUC). All material is available under the Creative Commons Attribution-NonCommercial License. These labs are developed by Abdul Dakkak and Carl Pearson
You must use an NVIDIA CUDA-enabled GPU to use the compiled binaries.
Learn how to run these labs on AWS GPUs in the cloud using the NVIDIA-Docker instructions.**
The labs in the Teaching Kit require a CUDA supported operating system, C compiler, and the CUDA 8 Toolkit. The CUDA 8 Toolkit can be downloaded from the CUDA Download page. Instructions on how to install the CUDA Toolkit are available in the Quick Start page. Installation guides and the list of supported C compilers for Windows, Linux, and OSX are also found in the CUDA Toolkit Documentation Page.
Aside from a C compiler and the CUDA Toolkit, CMake 3.17 or later is required to generate build scripts for your target IDE and compiler.
The usage of OpenACC directives for the Module 21 labs requires access to the PGI OpenACC compiler. Please follow the instructions here in this Bitbucket repository to download the tools, generate the license file and install the license.
The next section describes the process of compiling and running a lab.
In this section we describe how to setup your machine to compile the labs. First, regardless of the platform compiling the labs the CUDA Toolkit and CMake must be installed.
Now, checkout the the GPU Teaching Kit – Accelerated Computing Labs from this Bitbucket repository.
To clone the repository use:
git clone git@bitbucket.org:nvidia-dli/gputeachingkit-labs.git
Observation to users with an existing git clone obtained previous to 07/15/2020, we strongly recommend getting a fresh clone instead of performing a git pull for obtaining the updated repo.
In the next section we will show how to compile and run the labs on Linux, OSX, and Windows.
We will show how to compile the labs on both Linux and OSX using Makefiles. First, create the target build directory
mkdir build-dir
cd build-dir
We will use ccmake
ccmake /path/to/gpu-kit-git-checkout
You will see the following screen
Pressing c
would configure the build to your system (in
the process detecting the compiler, the CUDA Toolkit location,
etc…).
Note the options available to you, specifically:
BUILD_DESCRIPTION *OFF
BUILD_DATASET_GENERATOR *ON
BUILD_LIBgpuTK_LIBRARY *ON
BUILD_SOLUTION *ON
BUILD_TEMPLATE *OFF
BUILD_JSONLOG *OFF
BUILD_LOGTIME *ON
BUILD_DESCRIPTION
– option toggles whether to
regenerate pdf
and docx
lab output (this
requires a python, latex, and pandoc installation)BUILD_DATASET_GENERATOR
– option toggles whether to
build the dataset generator scripts as part of the build processBUILD_LIBgpuTK_LIBRARY
– option toggles whether to
build the libgpuTK
(the support library) as part of the
build processBUILD_TEMPLATE
– option toggles whether to build the
code templates as part of the build process (the templates are missing
critical code that makes them uncompilable).BUILD_JSONLOG
– option toggles whether to build the
libgpuTK
with detailed json logging to stdout. This option
is meant for extreme debugging of the code logs.BUILD_LOGTIME
– option toggles whether to build the
libgpuTK
with timers printing to stdout the elapsed time in
ms
for the operation.Templates are meant to be used as starting code for students whereas the solution is meant for instructor use.
IMPORTANT NOTE: The lab code output format was originally json, by default, as this was necessary for UIUC’s WebGPU tool. The early goal of the Teaching Kit was to provide educators the option to use this tool, but that is no longer recommended. Text output is now the default, but you can switch back to json output by adding “-DJSON_OUTPUT” to CMAKE_CXX_FLAGS. You need to use “t” to show the advanced mode that includes CMAKE_CXX_FLAGS.
If you have modified the above, then you should type g
to regenerate the Makefile and then q
to quit out of
ccmake
. You can then use the make
command to
build the labs.
The make
scripts builds the executables which can be run
using the command template provided in the lab’s description. Here we
run the DeviceQuery
lab.
The usage of CMake on windows is the same as that on linux, except for windows we will using the GUI version (one can still use the command line version however).
First, launch the CMake gui application and set your source directory (the checkout directory) and the build directory (where you want the labs to be built).
Clicking configure gives you an option to select which compiler to use to compile the labs. The compiler must be installed on the system and support by the CUDA toolkit
The CMake system then searches the system and populates the proper options in your configuration. As a user you can override these options if needed
Clicking Generate
button, the CMake system creates the
build scripts in the previously specified build directory. Since we
selected Visual Studio, a Visual Studio solution is generated.
Opening the Visual Studio solution, you can edit and compile all the labs
The labs are built like any Visual Studio project using the build button
Once the lab is built, it can be run. Here we run the device query lab
Included with the Teaching Kit is a Docker build file. This file can be used to build and launch a container which contains the Teaching Kit labs along with all the software required to run them. Using a GPU within Docker is only supported on Linux, and we recommend using NVIDIA-Docker to run the Docker image. To build the Docker container:
docker build . -t gputeachingkit
Once built, the gputeachingkit
image will be listed by
the docker images
command. Launching the Docker container
locally with GPU support is best accomplished using NVIDIA-Docker.
Launching the Docker container on AWS and other GPUs in the cloud is also supported by NVIDIA-Docker and you can refer to their wiki for details.
For an overview of NVIDIA-Docker, please see their blog post.
By default, docker volumes are not persistent. To preserve your code
across docker sessions, a volume must be shared between the host system
and the container. The following command mounts
$HOME/teachingkit_src
on the host system to
/opt/teachingkit/src
in the container.
nvidia-docker run -v $HOME/teachingkit_src:/opt/teachingkit/src -it gputeachingkit
The Docker documentation has more details on how to manage docker volumes.
The NVIDIA Accelerated Computing Teaching Kit includes links to online DLI courses. DLI training reinforces deep learning concepts presented in the Teaching Kits and teaches students how to apply those concepts to end-to-end projects. Through built-in assessments, students can earn certifications that prove subject matter competency and can be leveraged for professional career growth. Each course presents a self-paced learning environment with access to a GPU-accelerated workstation in the cloud. All students need is a web browser and Internet connection to get started. Although these courses are designed to be taken online, you are free to administer them to your students in a live setting as well.
The recommended DLI course (with certification) for students learning through the Accelerated Computing Teaching Kit is Fundamentals of Accelerated Computing with CUDA C/C++.
Syllabus.pdf
suggests students take this full-day course
upon near-completion of your university semester course. It also
suggests shorter courses that can be used as labs throughout your
university course.
Detailed descriptions of all available DLI courses can be found at www.nvidia.com/dli.
The NVIDIA Deep Learning Institute (DLI) offers hands-on training for developers, datascientists, and researchers looking to solve challenging problems with deep learning and accelerated computing. Through built-in assessments, students can earn certifications thatprove subject matter competency and can be leveraged for professional career growth.
In addition to online, self-paced courses, DLI offers all fundamentals and industry-specific courses as in-person workshops led by DLI-certified instructors. View upcoming workshops near you at www.nvidia.com/dli.