Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jetsonhacks
Last active June 21, 2020 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jetsonhacks/a2a67dc653afd1f152029efd77ef9344 to your computer and use it in GitHub Desktop.
Save jetsonhacks/a2a67dc653afd1f152029efd77ef9344 to your computer and use it in GitHub Desktop.
Dockerfile for building simple nbody demo on Jetson
# Copyright (c) 2020, JetsonHacks. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# To enable access to the CUDA compiler (nvcc) during docker build operations, add "default-runtime": "nvidia" to your /etc/docker/daemon.json configuration file before attempting to build the containers:
# REMEMBER the pound sign is the comment for the Docker file, you will need to remove them for the real json file
# {
# "runtimes": {
# "nvidia": {sudo
# "path": "nvidia-container-runtime",
# "runtimeArgs": []
# }
# },
#
# "default-runtime": "nvidia"
# }
# Remember the , after "runtimes" {}
#You will then want to restart the Docker service or reboot your system before proceeding.
# $ sudo systemctl restart docker
# Run the nbody simulation sample
FROM nvcr.io/nvidia/l4t-base:r32.4.2
RUN apt-get update && apt-get install -y --no-install-recommends make g++
RUN cp -r /usr/local/cuda/samples /tmp/samples
WORKDIR /tmp/samples/5_Simulations/nbody
RUN make clean && make
CMD ["./nbody"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment