Skip to content

Commit

Permalink
Holoscan SDK v0.5.0 Release
Browse files Browse the repository at this point in the history
Co-authored-by: Alexis Girault <[email protected]>
Co-authored-by: Andreas Heumann <[email protected]>
Co-authored-by: Anisha Goel <[email protected]>
Co-authored-by: Arun Patole <[email protected]>
Co-authored-by: Gigon Bae <[email protected]>
Co-authored-by: Gregory Lee <[email protected]>
Co-authored-by: Ian Stewart <[email protected]>
Co-authored-by: Jin Li (Worldwide Field Ops) <[email protected]>
Co-authored-by: Julien Jomier <[email protected]>
Co-authored-by: Matthew Wittwer <[email protected]>
Co-authored-by: Shekhar Dwivedi <[email protected]>
Co-authored-by: Suresh Ramani <[email protected]>
Co-authored-by: Victor Chang <[email protected]>
Co-authored-by: Wendell Hom <[email protected]>
Co-authored-by: Yu Asai <[email protected]>
  • Loading branch information
15 people committed Mar 31, 2023
1 parent dd03850 commit f409592
Show file tree
Hide file tree
Showing 557 changed files with 24,567 additions and 28,270 deletions.
6 changes: 5 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -42,3 +42,7 @@ RUN apt update \
git-lfs \
&& rm -rf /var/lib/apt/lists/*
ENV CMAKE_GENERATOR=Ninja

# Set the default user.
# (See https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user)
USER $USERNAME
28 changes: 15 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@
// https://code.visualstudio.com/docs/remote/devcontainerjson-reference
{
"name": "C++",
// Dockerfile in this VSCode DevContainer uses a cache image named `holoscan-sdk-dev` to
// speed up the build process. To rebuild the cache image before container creation, it runs:
//
// docker buildx use default # use the default builder to access all the cache images
// ./run build_image`
//
// as an initialization command.
// It also runs `./run install_gxf` to install the GXF library.
"initializeCommand": "docker buildx use default; ${localWorkspaceFolder}/run build_image; ${localWorkspaceFolder}/run install_gxf",
// Use 'initialize-command.sh' to execute initialization commands before the container is created.
"initializeCommand": ".devcontainer/initialize-command.sh",
"build": {
"dockerfile": "Dockerfile",
"args": {
Expand All @@ -22,6 +15,10 @@
"runArgs": [
"--runtime=nvidia",
"--net=host",
// Current VSCode DevContainer doesn't support dynamic 'runArgs' for docker
// (see https://github.com/microsoft/vscode-remote-release/issues/3972).
// So, we need to comment out the following lines when we don't use AJA Capture Card or video device.
//
// Uncomment the following line to use AJA Capture Card
// "--device=/dev/ajantv20:/dev/ajantv20",
// Uncomment the following line to use /dev/video0. Also, execute 'sudo chmod 666 /dev/video0' inside the container.
Expand All @@ -32,14 +29,19 @@
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}",
"NVIDIA_DRIVER_CAPABILITIES": "graphics,video,compute,utility,display",
// Set the following environment variables to use the same folder name as the host machine.
// This is needed to launch container from the workspace folder that is not same as the SDK source root folder.
"HOLOSCAN_PUBLIC_FOLDER": "${env:HOLOSCAN_PUBLIC_FOLDER}",
},
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
// Mount Vulkan driver ICD configuration (need to map two paths, the configurations files are installed to different locations
// when installing with deb packages or with run files)
// Mount Vulkan driver ICD configuration.
// Needed due to https://github.com/NVIDIA/nvidia-container-toolkit/issues/16
"source=/usr/share/vulkan/icd.d/nvidia_icd.json,target=/usr/share/vulkan/icd.d/nvidia_icd.json,type=bind,consistency=cached",
"source=/etc/vulkan/icd.d/nvidia_icd.json,target=/etc/vulkan/icd.d/nvidia_icd.json,type=bind,consistency=cached",
// The configurations files are installed to different locations depending on the installation method.
// (whether installing with deb packages or with run files)
// By the 'initializeCommand' script, the ICD configurations are copied to /tmp/holoscan_nvidia_icd.json and
// we mount it to /usr/share/vulkan/icd.d/nvidia_icd.json
"source=/tmp/holoscan_nvidia_icd.json,target=/usr/share/vulkan/icd.d/nvidia_icd.json,type=bind,consistency=cached",
],
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace/holoscan-sdk,type=bind,consistency=cached",
"workspaceFolder": "/workspace/holoscan-sdk",
Expand Down
72 changes: 72 additions & 0 deletions .devcontainer/initialize-command.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

SCRIPT_DIR=$(dirname "$(readlink -f "$0")")

# Actually, VSCode will run this script in the local workspace folder but
# it's better to be explicit.

# Get 'localWorkspaceFolder' environment variable from the script path.
localWorkspaceFolder=$(git rev-parse --show-toplevel 2> /dev/null || dirname $(dirname $(realpath -s $0)))

# Get the holoscan sdk top directory.
TOP=$(readlink -f "${SCRIPT_DIR}/..")

if [ "${localWorkspaceFolder}" != "${TOP}" ]; then
echo "Project (git) root is not Holoscan SDK source directory. Copying common-debian.sh from the source folder."
# In this case, project root is not Holoscan source root.
# If a file is symlinked, the symlinked file can't be copied to the container by Dockerfile.
# To prevent error, Copy common-debian.sh from the Holoscan source's .devcontainer folder to
# the project repository's .devcontainer folder.
cp -f ${TOP}/.devcontainer/library-scripts/common-debian.sh \
${localWorkspaceFolder}/.devcontainer/library-scripts/common-debian.sh
fi

# We need to mount Vulkan icd.d JSON file into the container due to this issue
# (https://github.com/NVIDIA/nvidia-container-toolkit/issues/16).
# However, the location of the file is different depending on the driver installation method:
# - deb packages: /usr/share/vulkan/icd.d/nvidia_icd.json
# - .run files: /etc/vulkan/icd.d/nvidia_icd.json
# So we need to check which one exists and mount it.

# Here, we copy the existing icd.d JSON file to the temporary directory (/tmp) and mount it to the
# location (/usr/share/vulkan/icd.d/nvidia_icd.json) that the container expects.
# It is because VSCode DevContainer doesn't support conditional mount points.
# (see https://github.com/microsoft/vscode-remote-release/issues/3972)
if [ -f /usr/share/vulkan/icd.d/nvidia_icd.json ]; then
icd_file=/usr/share/vulkan/icd.d/nvidia_icd.json
elif [ -f /etc/vulkan/icd.d/nvidia_icd.json ]; then
icd_file=/etc/vulkan/icd.d/nvidia_icd.json
else
>&2 echo "ERROR: Cannot find the Vulkan ICD file from /usr/share/vulkan/icd.d/nvidia_icd.json or /etc/vulkan/icd.d/nvidia_icd.json"
exit 1
fi

# Copy the file to the temporary directory with the name 'holoscan_nvidia_icd.json'.
cp ${icd_file} /tmp/holoscan_nvidia_icd.json
echo "Mounting ${icd_file} to /usr/share/vulkan/icd.d/nvidia_icd.json through /tmp/holoscan_nvidia_icd.json"

# Dockerfile in this VSCode DevContainer uses a cache image named `holoscan-sdk-dev` to
# speed up the build process. To rebuild the cache image before container creation, it runs:
#
# docker buildx use default # use the default builder to access all the cache images
# ./run build_image`
#
# as an initialization command.
# It also runs `./run install_gxf` to install the GXF library.
docker buildx use default
${TOP}/run build_image
${TOP}/run install_gxf
8 changes: 4 additions & 4 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{
"name": "x86_64",
"includePath": [
"${workspaceFolder}/include"
"${workspaceFolder}/${env:HOLOSCAN_PUBLIC_FOLDER}/include"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
// "compileCommands": "${workspaceFolder}/build-debug-x86_64/compile_commands.json",
// "compileCommands": "${workspaceFolder}/${env:HOLOSCAN_PUBLIC_FOLDER}/build-debug-x86_64/compile_commands.json",
"compileCommands": "${command:cmake.buildDirectory}/compile_commands.json",
"browse": {
"limitSymbolsToIncludedHeaders": true
Expand All @@ -21,14 +21,14 @@
{
"name": "arm64",
"includePath": [
"${workspaceFolder}/include"
"${workspaceFolder}/${env:HOLOSCAN_PUBLIC_FOLDER}/include"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-arm64",
// "compileCommands": "${workspaceFolder}/build-debug-arm64/compile_commands.json",
// "compileCommands": "${workspaceFolder}/${env:HOLOSCAN_PUBLIC_FOLDER}/build-debug-arm64/compile_commands.json",
"compileCommands": "${command:cmake.buildDirectory}/compile_commands.json",
"browse": {
"limitSymbolsToIncludedHeaders": true
Expand Down
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"akiramiyakoda.cppincludeguard",
"ms-vscode.cpptools-extension-pack",
"matepek.vscode-catch2-test-adapter",
"ms-vscode.makefile-tools",
"ms-python.python",
"ms-python.vscode-pylance",
"shardulm94.trailing-spaces",
Expand Down
Loading

0 comments on commit f409592

Please sign in to comment.