Sign inSign up

alexkennedy/sargpu

By alexkennedy

Updated about 6 years ago

Image
0

149

alexkennedy/sargpu repository overview

GPU Accelerated SAR Processing

Code and logs repository for the research project I'm doing into GPU-accelerated SAR processing using a Nvidia Jetson (in space, one day).

Getting Started

Prerequisites

To compile the code, you will need git and Docker installed on your local machine.

To run the code, you will need a Nvidia CUDA-capable GPU on a Linux machine (it is probably possible to run the code on a different OS, but for this, you're on your own).

Getting the code

In a command line, start by cloning this repository.

git clone https://github.com/alex-kennedy/sargpu
cd sargpu

Install the submodules of this repository with

git submodule init
git submodule update

The CUDA samples are then installed in this repository as a submodule.

Docker

This project uses Docker. To build and run the images on any machine, you will first need to install Docker for the appropriate operating system.

It's worth reading some introductory material on Docker (Docker Getting Started)if you are not familiar. Docker is a product which allows containerisation, a technology to package code in a self-contained, reproducible 'container'.

Building Images

There are two Dockerfiles for this project.

  • Dockerfile.aarch64 - this image is for running the project on a Nvidia Jetson unit. This image can be built on an x86_64 system (normal computer), but can only be run on the Jetson equipment following the instructions below. This tool is in beta, and original instructions can be found here.
  • Dockerfile.x86_64 - this image is for running the project on a normal system, but will not run on the Jetson modules.

To build the images, run

docker build -f Dockerfile.aarch64 . -t sargpu:aarch64-latest

or

docker build -f Dockerfile.x86_64 . -t sargpu:x86_64-latest

The -t flag tags the image build. The tags specified above are local tags. If you instead wish to upload a new version of a container, you could instead tag them with (for example), alexkennedy/sargpu:aarch64-latest or alexkennedy/sargpu:x86_64-latest.

Pushing/Pulling Images

These images are also stored in Docker Hub under my username, alexkennedy. Docker Hub is a free host for built Docker images.

To pull the images, use

docker pull alexkennedy/sargpu:aarch64-latest

or

docker pull alexkennedy/sargpu:x86_64-latest

To push them, you'll first want to build, and then push them with the above commands, with pull replaced with push. You will need me to give you access to this repository to push them. Or, you could push them to your own account. This is the easiest way to transfer an image built locally to another machine.

Running Images

To run images, the image host must have nvidia-container-toolkit installed.

sudo apt-get install nvidia-container-toolkit

The Jetson will need to have the JetPack toolkit installed. A non-Jetson host will need to have the appropriate Nvidia drivers installed for the graphics card. Follow instructions here to get this set up. The host machine will need a CUDA-capable graphics card.

To the meat. Currently the images do very little. They compile some CUDA sample code and open when one is run, they simply open bash into the image.

Run

docker run -it --rm --gpus=all alexkennedy/sargpu:x86_64-latest

or on the Jetson,

docker run -it --rm --gpus=all alexkennedy/sargpu:aarch64-latest

This run command -it flags signal the session will be interactive and opens a tty, the image will be removed after the shell exits (--rm), and attaches all the GPUs of the host to the container (--gpus=all).

Check the output

At the moment, the only thing these run commands will do is create an image, attach the GPUs, and run the deviceQuery, printing the result. The main thing you're looking for is the last line, pass or fail.

If it fails, you might see something like this:

/app/src/cuda-samples/bin/x86_64/linux/release/deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

If it succeeds, you might see something like this (this is just an example based on my Nvidia Jetson Nano):

/app/src/cuda-samples/bin/aarch64/linux/release/deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "NVIDIA Tegra X1"
  CUDA Driver Version / Runtime Version          10.0 / 10.0
  CUDA Capability Major/Minor version number:    5.3
  Total amount of global memory:                 3964 MBytes (4156911616 bytes)
  ( 1) Multiprocessors, (128) CUDA Cores/MP:     128 CUDA Cores
  GPU Max Clock rate:                            922 MHz (0.92 GHz)
  Memory Clock rate:                             1600 Mhz
  Memory Bus Width:                              64-bit
  L2 Cache Size:                                 262144 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 32768
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            Yes
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device supports Compute Preemption:            No
  Supports Cooperative Kernel Launch:            No
  Supports MultiDevice Co-op Kernel Launch:      No
  Device PCI Domain ID / Bus ID / location ID:   0 / 0 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.0, CUDA Runtime Version = 10.0, NumDevs = 1
Result = PASS

Tag summary

Content type

Image

Digest

Size

1.2 GB

Last updated

about 6 years ago

docker pull alexkennedy/sargpu:x86_64-latest