Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson committed Mar 24, 2020
0 parents commit 72ce0aa
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dist: bionic
language: minimal
arch:
- ppc64le
- amd64

docker: true

before_script:
- ci/install_deps.sh || travis_terminate 1;

script:
- ci/build.sh || travis_terminate 1;
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Nvidia Performance Tools

## Docker images with Nvidia's Performance Tools

[cwpearson/nvidia-performance-tools on Docker Hub](https://hub.docker.com/repository/docker/cwpearson/nvidia-performance-tools).

```bash
docker pull cwpearson/nvidia-performance-tools/latest-amd64
docker pull cwpearson/nvidia-performance-tools/latest-ppc64le
```

## Presentations

[ECE 408 Spring 2020 - Introduction to Nvidia Performance Tools](https://docs.google.com/presentation/d/1A5i3Zdh7ltOLdW7qHZ2tviXYcyl1sKvM7kRpnzOD7tQ/edit?usp=sharing)

## Nsight Compute

```bash
nv-nsight-cu-cli a.out
nv-nsight-cu-cli --csv a.out

```

## Nsight Systems

```bash
nsys profile a.out
```


## Managing docker images

* `docker ps -a`
* `docker rm `docker ps -a -q``

## Resources

* [Using Nvidia Nsight Systems in Containers and the Cloud](https://devblogs.nvidia.com/nvidia-nsight-systems-containers-cloud/)
29 changes: 29 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
set -x

set -e

cd docker
ls -halt

echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin

TRAVIS_COMMIT=${TRAVIS_COMMIT:0:7}
DOCKER_REPO=nvidia-performance-tools
DOCKER_SLUG=$DOCKER_USER/$DOCKER_REPO
DOCKER_TAG=$TRAVIS_CPU_ARCH-10.2-$TRAVIS_BRANCH-$TRAVIS_COMMIT


docker build -f $TRAVIS_CPU_ARCH.dockerfile -t $DOCKER_SLUG:$DOCKER_TAG .
docker push $DOCKER_SLUG:$DOCKER_TAG


if [[ $TRAVIS_BRANCH == master ]]; then
docker tag $DOCKER_SLUG:$DOCKER_TAG $DOCKER_SLUG:latest-$TRAVIS_CPU_ARCH
docker push $DOCKER_SLUG:latest-$TRAVIS_CPU_ARCH
else
docker tag $DOCKER_SLUG:$DOCKER_TAG $DOCKER_SLUG:$TRAVIS_BRANCH-$TRAVIS_CPU_ARCH
docker push $DOCKER_SLUG:$TRAVIS_BRANCH-$TRAVIS_CPU_ARCH
fi

# remove the login key from the image
rm -fv $HOME/.docker/config.json
13 changes: 13 additions & 0 deletions ci/install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set -x
set -e

sudo apt-get update
sudo apt-get install -q -y wget

if [[ $TRAVIS_CPU_ARCH == ppc64le ]]; then
wget -qSL https://uofi.box.com/shared/static/vfxflckdjixxkc524qltme4sx8kt3w9d.deb -O docker/NVIDIA_Nsight_Systems_Power_CLI_Only_2020.2.1.71.deb;
wget -qSL https://uofi.box.com/shared/static/swjp2bjr7xj153vzw8mvutv2tqomypxu.run -O docker/nsight-compute-PPC64LE-2019.5.0.14-27346997.run;
elif [[ $TRAVIS_CPU_ARCH == amd64 ]]; then
wget -qSL https://uofi.box.com/shared/static/zjsv2rayiotyrdix6a6yd3w8cre56lo0.deb -O docker/NVIDIA_Nsight_Systems_Linux_2020.2.1.71.deb;
wget -qSL https://uofi.box.com/shared/static/4fuf3wws1uplhf29ndcq4s91kl3jyl7z.run -O docker/nsight-compute-linux-2019.5.0.14-27346997.run;
fi
26 changes: 26 additions & 0 deletions docker/amd64.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM nvidia/cuda:10.2-devel-ubuntu18.04

# Set one or more individual labels
LABEL maintainer="Carl Pearson"

# prevent prompts during apt-get
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y -q --no-install-recommends --no-install-suggests \
cmake \
libglib2.0 \
&& rm -rf /var/lib/apt/lists/*

COPY test.cu .
COPY nsight-compute-linux-2019.5.0.14-27346997.run nsight_compute.run
COPY NVIDIA_Nsight_Systems_Linux_2020.2.1.71.deb nsight_systems.deb

# install Nsight Compute
# install script seems to want TERM set
RUN chmod +x nsight_compute.run
RUN TERM=xterm ./nsight_compute.run --quiet -- -noprompt -targetpath=/usr/local/NVIDIA-Nsight-Compute
ENV PATH=$PATH:/usr/local/NVIDIA-Nsight-Compute

# install Nsight Systems
RUN dpkg -i nsight_systems.deb
26 changes: 26 additions & 0 deletions docker/ppc64le.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM nvidia/cuda-ppc64le:10.2-devel-ubuntu18.04

# Set one or more individual labels
LABEL maintainer="Carl Pearson"

# prevent prompts during apt-get
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y -q --no-install-recommends --no-install-suggests \
cmake \
libglib2.0 \
&& rm -rf /var/lib/apt/lists/*

COPY test.cu .
COPY nsight-compute-PPC64LE-2019.5.0.14-27346997.run nsight_compute.run
COPY NVIDIA_Nsight_Systems_Power_CLI_Only_2020.2.1.71.deb nsight_systems.deb

# install Nsight Compute
# install script seems to want TERM set
RUN chmod +x nsight_compute.run
RUN TERM=xterm ./nsight_compute.run --quiet -- -noprompt -targetpath=/usr/local/NVIDIA-Nsight-Compute
ENV PATH=$PATH:/usr/local/NVIDIA-Nsight-Compute

# install Nsight Systems
RUN dpkg -i nsight_systems.deb
11 changes: 11 additions & 0 deletions docker/test.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__global__ void kernel(float *a, float *b, int n) {
*a = *b;
}

int main(void) {
float *a, *b;
cudaMalloc(&a, 10 * sizeof(float));
cudaMalloc(&b, 10 * sizeof(float));
kernel<<<1,1>>>(a,b,10);
cudaDeviceSynchronize();
}

0 comments on commit 72ce0aa

Please sign in to comment.