Skip to content

Commit

Permalink
Merge pull request #37 from NVIDIA/release_0_4_0
Browse files Browse the repository at this point in the history
Release 0.4.0. See CHANGELOG.md for changes.
  • Loading branch information
AndreasHeumann authored Apr 10, 2024
2 parents 33f9a79 + 80774ff commit b48d0dc
Show file tree
Hide file tree
Showing 77 changed files with 8,803 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python/notebooks/*
src/python/notebooks/*
**/build
**/data
**/node_modules
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ build*/*
**/video.mp4

# notebooks
python/notebooks/HelloWorld.jpg
python/notebooks/data/bonsai/*.nhdr
python/notebooks/data/bonsai/*.raw
python/notebooks/data/pancreas/*.raw
python/notebooks/data/OpenSlide/*.tiff
src/python/notebooks/HelloWorld.jpg
src/python/notebooks/data/bonsai/*.nhdr
src/python/notebooks/data/bonsai/*.raw
src/python/notebooks/data/pancreas/*.raw
src/python/notebooks/data/OpenSlide/*.tiff
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# clara-viz 0.4.0 (April 10 2024)

## Features

* Add Python and pybind11 source code
* Add support for Python 3.10 and 3.11 packages and set Python wheel requirement to fail installation on unsupported Python versions

## Bug Fixes

* Add missing <thread> include to DataSourceUS.cpp ([32](https://github.com/NVIDIA/clara-viz/pull/32)) [@thewtex](https://github.com/thewtex)
* Upgrade almalinux-release in Docker build for GPG keys ([31](https://github.com/NVIDIA/clara-viz/pull/32)) [@thewtex](https://github.com/thewtex)
* Gracefully disable OptiX and NvENC features if initialization fails.
* Python: Fix segfault when accessing RGBA data of rendered image ([33](https://github.com/NVIDIA/clara-viz/issues/33)) [@thewtex](https://github.com/thewtex)

# clara-viz 0.3.2 (November 27 2023)

## Features
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@ include(ExternalProject)

project(ClaraViz
DESCRIPTION "ClaraViz"
VERSION 0.3.2
VERSION 0.4.0
LANGUAGES CXX
)

Expand Down
5 changes: 3 additions & 2 deletions Dockerfile_aarch64.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019-2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,12 +19,13 @@ FROM ${DOCKER_HUB}nvidia/cuda:11.2.2-devel-ubuntu18.04
# * wget, ca-certificates: to download packages
# * build-essential: for building code
# * git: used by cmake to clone git projects
# * python3-dev, python3-distutils: for ClaraViz python backend
# * nasm: used by openh264
# * libx11-dev: used by 'claravizrenderer-ui' example
RUN apt-get update \
&& apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget ca-certificates build-essential git nasm libx11-dev \
wget ca-certificates build-essential git python3-dev python3-distutils nasm libx11-dev \
&& rm -rf /var/lib/apt/lists/*

# Install git-lfs to be used by cmake
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_x86_64.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2019-2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ docker run --network host --rm -it -u $(id -u):$(id -g) -v $PWD:/ClaraViz \
git
git-lfs
nasm
CMake 3.19.1
CMake 3.24.0
python3-dev
python3-distutils

#### Build

Expand Down Expand Up @@ -90,4 +92,4 @@ is used in this project.

Apache-2.0 License (see `LICENSE` file).

Copyright (c) 2020-2023, NVIDIA CORPORATION.
Copyright (c) 2020-2023, NVIDIA CORPORATION.
Binary file modified bin/aarch64/ClaraVizRenderServer
Binary file not shown.
Binary file modified bin/x86_64/ClaraVizRenderServer
Binary file not shown.
4 changes: 2 additions & 2 deletions cmake/clara_viz_rendererConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ endif()
# Import target "clara::viz::renderer" for configuration "Release"
set_property(TARGET clara::viz::renderer APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(clara::viz::renderer PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.3.2"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.4.0"
IMPORTED_SONAME_RELEASE "libclara_viz_renderer.so.0"
)

list(APPEND _cmake_import_check_targets clara::viz::renderer )
list(APPEND _cmake_import_check_files_for_clara::viz::renderer "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.3.2" )
list(APPEND _cmake_import_check_files_for_clara::viz::renderer "${_IMPORT_PREFIX}/lib/${CMAKE_SYSTEM_PROCESSOR}/libclara_viz_renderer.so.0.4.0" )

# Cleanup temporary variables.
set(_IMPORT_PREFIX)
Expand Down
6 changes: 3 additions & 3 deletions cmake/clara_viz_rendererConfigVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
# The variable CVF_VERSION must be set before calling configure_file().


set(PACKAGE_VERSION "0.3.2")
set(PACKAGE_VERSION "0.4.0")

if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

if("0.3.2" MATCHES "^([0-9]+)\\.")
if("0.4.0" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif()
else()
set(CVF_VERSION_MAJOR "0.3.2")
set(CVF_VERSION_MAJOR "0.4.0")
endif()

if(PACKAGE_FIND_VERSION_RANGE)
Expand Down
2 changes: 1 addition & 1 deletion lib/aarch64/libclara_viz_renderer.so.0
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/x86_64/libclara_viz_renderer.so.0
Binary file not shown.
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ endif()

project(ClaraVizServer
DESCRIPTION "ClaraVizServer"
VERSION 0.3.2
VERSION 0.4.0
LANGUAGES CXX
)

Expand All @@ -38,6 +38,7 @@ endif()
if (CLARA_VIZ_WITH_GRPC)
add_subdirectory(nvrpc)
add_subdirectory(protos)
add_subdirectory(python)
endif()

add_subdirectory(claraviz)
2 changes: 1 addition & 1 deletion src/claraviz/core/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum class ColorImageType
*/
UNKNOWN,
/**
* RAW uncompressed RGB unsigned int 8-bit with unused unsigned int 8-bit
* RAW uncompressed RGBA unsigned int 8-bit
* This is a word-ordered format where a pixel is represented by a 32-bit word with R
* in the lowest 8 bits, G in the next 8 bits, B in the
* 8 bits after that and A in the highest 8 bits.
Expand Down
13 changes: 11 additions & 2 deletions src/claraviz/core/Video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,19 @@ std::unique_ptr<IVideoEncoder> Video::Impl::CreateEncoder() const
{
std::unique_ptr<IVideoEncoder> encoder;

encoder.reset(new NvEncVideoEncoder(cuda_device_ordinal_));
if (!encoder->Query(IVideoEncoder::Capability::IS_SUPPORTED))
try
{
encoder.reset(new NvEncVideoEncoder(cuda_device_ordinal_));
}
catch (const std::exception& e)
{
Log(LogLevel::Warning) << "Failed to create NvEnc video encoder";
}

if (!encoder)
{
#ifdef CLARA_VIZ_WITH_OPENH264
Log(LogLevel::Warning) << "Falling back to CPU based video encoding";
encoder.reset(new OpenH264VideoEncoder(cuda_device_ordinal_));
if (!encoder->Query(IVideoEncoder::Capability::IS_SUPPORTED))
#endif
Expand Down
6 changes: 5 additions & 1 deletion src/claraviz/hardware/nvenc/NvEncService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ const NV_ENCODE_API_FUNCTION_LIST &NvEncService::GetApi() const

NVENCSTATUS NvEncDestroyEncoder(void *encoder)
{
return NvEncService::GetInstance().GetApi().nvEncDestroyEncoder(encoder);
if (encoder)
{
return NvEncService::GetInstance().GetApi().nvEncDestroyEncoder(encoder);
}
return NV_ENC_SUCCESS;
}

} // namespace clara::viz
4 changes: 4 additions & 0 deletions src/claraviz/video/NvEncVideoEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ class NvEncVideoEncoder::Impl
NvEncVideoEncoder::NvEncVideoEncoder(uint32_t cuda_device_ordinal)
: impl_(new Impl(cuda_device_ordinal))
{
if (!Query(IVideoEncoder::Capability::IS_SUPPORTED))
{
throw RuntimeError() << "HW accelerated video encoding not supported";
}
}

NvEncVideoEncoder::~NvEncVideoEncoder() {}
Expand Down
2 changes: 1 addition & 1 deletion src/examples/renderer/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "claraviz-example",
"version": "0.3.2",
"version": "0.4.0",
"description": "RenderServer example",
"dependencies": {
"@grpc/proto-loader": "^0.6.9",
Expand Down
4 changes: 2 additions & 2 deletions src/examples/volumestreamrenderer/DataSourceUS.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -412,4 +412,4 @@ void DataSourceUS::TransferFunction(TransferFunctionInterface &interface)
}
}

} // namespace clara::viz
} // namespace clara::viz
2 changes: 1 addition & 1 deletion src/examples/volumestreamrenderer/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui",
"version": "0.3.2",
"version": "0.4.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
Expand Down
15 changes: 15 additions & 0 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
#
# 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.

add_subdirectory(pybind11)
File renamed without changes.
11 changes: 11 additions & 0 deletions src/python/clara-viz-core/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include clara/viz/core/VERSION

include LICENSE
include setup.py

# Patterns to exclude from any directory
global-exclude *~
global-exclude *.pyc
global-exclude *.pyo
global-exclude .git
global-exclude *.map
25 changes: 25 additions & 0 deletions src/python/clara-viz-core/clara/viz/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved.
#
# 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.

"""clara-viz-core: Core functionality for Clara Viz."""

from ._version import __version__

from .datadefinition import DataDefinition

# import C++ bindings ('_viz') to be exported by the 'clara.viz.core' (without underline) package
try:
from ._viz import Array, ImageCapsule, ColorImageType, InterfaceSelector, Renderer, VideoStream, ViewMode
except ImportError:
from _viz import Array, ImageCapsule, ColorImageType, InterfaceSelector, Renderer, VideoStream, ViewMode
40 changes: 40 additions & 0 deletions src/python/clara-viz-core/clara/viz/core/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
#
# 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.

# Module version
from packaging import version

# _version.py is used both by setup.py and __init__.py. setup.py is using
# exec() from the parent folder and __init__.py is using import from the
# current folder. We have to look at different locations for the VERSION
# file.
try:
__file__
except:
with open('clara/viz/core/VERSION', 'r') as f:
version = version.parse(f.read())
else:
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dir_path, 'VERSION'), 'r') as f:
version = version.parse(f.read())

version_info = (version.major, version.minor, version.micro, 'final', 0)

# Module version stage suffix map
_specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''}

# Module version accessible using clara.viz.__version__
__version__ = '%s.%s.%s%s' % (version_info[0], version_info[1], version_info[2],
'' if version_info[3] == 'final' else _specifier_[version_info[3]]+str(version_info[4]))
Loading

0 comments on commit b48d0dc

Please sign in to comment.