Mr. Peabody and Sherman

Project Hello World

by: burt rosenberg
at: university of miami
date: aug 2024

Goals

The goals of this project are to familiarize yourself with the software tools to be used in this course, and to run your first Cuda program.

Project activity

Log onto ssh.cs.miami.edu using your class credentials. This machine is on the same network of workstations, including those named,

Log onto one of those and check that the GPU device is working by running nvidia-smi.

@zizkaea:~$ nvidia-smi
Wed Aug 28 19:35:09 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.28.03              Driver Version: 560.28.03      CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3070        Off |   00000000:01:00.0 Off |                  N/A |
| 30%   28C    P8             16W /  220W |      15MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
☛ Clone the class repo.

There is a single repo for all the projects, even for the 231 edition of this course.

The Makefiles should have the pathname to nvcc, the Nvidia compiler needed to compile CUDA code. Note that files with Cuda code look like C, and have extension cu.

If this is all correct, Make in the proj1 subdirectory should produce this output:

@zizkaea:~/accelerate/proj1$ make
/usr/local/cuda/bin/nvcc hello.cu -o hello
./hello
Hello World from CPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
Hello World from GPU!
@zizkaea:~/accelerate/proj1$ 
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

author: burton rosenberg
created: 28 aug 2022
update: 28 nov 2024