Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions RenderingToolkit/GettingStarted/01_ospray_gsg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ if(DEFINED ENV{ONEAPI_ROOT})
set(ONEAPI_ROOT "$ENV{ONEAPI_ROOT}")
message(STATUS "ONEAPI_ROOT FROM ENVIRONMENT: ${ONEAPI_ROOT}")
else()
if(WIN32)
set(ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI")
else()
set(ONEAPI_ROOT /opt/intel/oneapi)
endif()
message(STATUS "ONEAPI_ROOT DEFAULT: ${ONEAPI_ROOT}")
message(FATAL_ERROR "ONEAPI_ROOT NOT set. Please source environment variables.")
endif(DEFINED ENV{ONEAPI_ROOT})

list(APPEND CMAKE_PREFIX_PATH "${ONEAPI_ROOT}/rkcommon/latest")
find_package(ospray REQUIRED PATHS ${ONEAPI_ROOT})
set(RKCOMMON_BASE_PATH "")
set(OSPRAY_BASE_PATH "")
if(EXISTS ${ONEAPI_ROOT}/oneapi-vars.sh OR EXISTS ${ONEAPI_ROOT}/oneapi-bars.bat)
set(RKCOMMON_BASE_PATH "${ONEAPI_ROOT}")
set(OSPRAY_BASE_PATH "${ONEAPI_ROOT}")
else()
set(RKCOMMON_BASE_PATH "${ONEAPI_ROOT}/rkcommon/latest")
set(OSPRAY_BASE_PATH "${ONEAPI_ROOT}/ospray/latest")
endif(EXISTS ${ONEAPI_ROOT}/oneapi-vars.sh OR EXISTS ${ONEAPI_ROOT}/oneapi-bars.bat)

list(APPEND CMAKE_PREFIX_PATH "${RKCOMMON_BASE_PATH}")
find_package(ospray REQUIRED PATHS ${OSPRAY_BASE_PATH})

if(MSVC)
set(CMAKE_CXX_STANDARD 11)
Expand All @@ -26,7 +31,7 @@ else()
endif(MSVC)

include_directories(${OSPRAY_INCLUDE_DIR} ${RKCOMMON_INCLUDE_DIRS})
link_directories(${OSPRAY_ROOT}/lib ${ONEAPI_ROOT}/rkcommon/latest/lib)
link_directories(${OSPRAY_ROOT}/lib ${RKCOMMON_BASE_PATH}/lib)

add_executable(ospTutorialCpp ${OSPRAY_RESOURCE} src/ospTutorial.cpp)
target_link_libraries(ospTutorialCpp PRIVATE ospray rkcommon)
Expand Down
78 changes: 62 additions & 16 deletions RenderingToolkit/GettingStarted/01_ospray_gsg/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Getting Started Sample for Intel® oneAPI Rendering Toolkit (Render Kit): Intel® OSPRay
# Getting Started Sample for Intel® Rendering Toolkit (Render Kit): Intel® OSPRay

Intel® OSPRay is an open source, scalable, and portable ray tracing engine
for high-performance, high-fidelity visualization. Easily build applications
that use ray tracing based rendering for both surface and volume-based
visualizations. OSPRay builds on top of Intel® Embree, Intel® Open
visualizations. OSPRay uses abstracted functionality from Intel® Embree, Intel® Open
Volume Kernel Library (Intel® Open VKL), and Intel® Open Image Denoise.

| Minimum Requirements | Description
|:--- |:---
| OS | Linux* Ubuntu* 18.04 <br>CentOS 8 (or compatible) <br>Windows* 10 <br>macOS* 10.15+
| OS | Linux* Ubuntu* 22.04 <br>CentOS 8 (or compatible) <br>Windows* 10 or 11<br>macOS* 10.15+
| Hardware | Intel 64 Penryn or newer with SSE4.1 extensions, ARM64 with NEON extensions <br>(Optimized requirements: Intel 64 Skylake or newer with AVX512 extentions, ARM64 with NEON extensions)
| Compiler Toolchain | Windows OS: MSVS 2019 installed with Windows SDK and CMake*; Other platforms: C++11 compiler, a C99 compiler (for example, gcc/c++/clang), and CMake*
| Libraries | Install Intel&reg; oneAPI Rendering Toolkit (Render Kit), including Intel&reg; OSPRay, Intel&reg; Embree, Intel&reg; Open VKL, and Intel&reg; Open Image Denoise
| Compiler Toolchain | Windows OS: MSVS 2022 (or 2019) installed with Windows SDK and CMake*; Other platforms: C++11 compiler, a C99 compiler (for example, gcc/c++/clang), and CMake*
| Libraries | Install Intel&reg; oneAPI Rendering Toolkit (Render Kit), including Intel&reg; OSPRay, Intel&reg; Embree, Intel&reg; Open VKL, and Intel&reg; Open Image Denoise; Install Intel&reg; oneAPI Base Toolkit (Base Kit) for Intel&reg; oneAPI DPC++ Compiler and Runtimes
| Image Display Tool | A .ppm filetype viewer (for example, [ImageMagick](https://www.imagemagick.org)).


Expand Down Expand Up @@ -52,14 +52,9 @@ Volume Kernel Library (Intel&reg; Open VKL), and Intel&reg; Open Image Denoise.

## Build and Run

### Additional Notes

oneAPI Rendering Toolkit 2023.1 version's cmake file contains an errata. The errata will produce an error while building the example. Please apply the following workaround described in the following page. 2023.1.1 version will address the issue.

https://community.intel.com/t5/Intel-oneAPI-Rendering-Toolkit/2023-1-troubleshoot-errata-CMake-Error/m-p/1476040#M98
### Windows

1. Run a new **x64 Native Tools Command Prompt for MSVS 2019**.
1. Run a new **x64 Native Tools Command Prompt for MSVS 2022**.

```
call <path-to-oneapi-folder>\setvars.bat
Expand All @@ -69,21 +64,45 @@ cd build
cmake ..
cmake --build . --config Release
cd Release
ospTutorialCpp.exe
.\ospTutorialCpp.exe
```
2. Example stdout output:
```
rendering initial frame to firstFrameCpp.ppm
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
picked geometry [instance: 0000028FEA8F9860, model: 0000028FEA8CAE50, primitive: 1]
```

2. Review the first output image with a .ppm image viewer. Example using
3. Review the first output image with a .ppm image viewer. Example using
ImageMagick display:
```
<path-to-ImageMagick>\imdisplay.exe firstFrameCpp.ppm
```

3. Review the accumulated output image with a .ppm image viewer. Example using
4. Review the accumulated output image with a .ppm image viewer. Example using
ImageMagick display:
```
<path-to-ImageMagick>\imdisplay.exe accumulatedFrameCpp.ppm
```

5. GPU (Beta in 2024.0) users try running the application in GPU mode:
```
REM close imdisplay and delete get started images
del firstFrameCpp.ppm
del AccumulatedFrameCpp.ppm
REM run program
.\ospTutorialCpp.exe

```

6. Review stdout output. Notice, picking `ospPick(..)` functionality is not available on GPU in the initial Intel&reg; OSPray 3.0 release:
```
rendering initial frame to firstFrameCpp.ppm
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
picked geometry [instance: 0000000000000000, model: 0000000000000000, primitive: 4294967295]
```

7. Review GPU generated output images like steps 4. and 5. above.

### Linux

Expand All @@ -98,17 +117,44 @@ cmake --build .
./ospTutorialCpp
```

2. Review the first output image with a .ppm image viewer. Example using
2. Example stdout output:
```
rendering initial frame to firstFrameCpp.ppm
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
picked geometry [instance: 0000028FEA8F9860, model: 0000028FEA8CAE50, primitive: 1]
```

3. Review the first output image with a .ppm image viewer. Example using
ImageMagick display:
```
<path-to-ImageMagick>/display-im6 firstFrameCpp.ppm
```

3. Review the accumulated output image with a .ppm image viewer. Example using
4. Review the accumulated output image with a .ppm image viewer. Example using
ImageMagick display:
```
<path-to-ImageMagick>/display-im6 accumulatedFrameCpp.ppm
```

5. GPU (Beta in 2024.0) users try running the application in GPU mode:
```
# close display-im6 and delete get started images
rm firstFrameCpp.ppm
rm AccumulatedFrameCpp.ppm
# run program
./ospTutorialCpp

```

6. Review stdout output. Notice, picking `ospPick(..)` functionality is not available on GPU in the initial Intel&reg; OSPray 3.0 release:
```
rendering initial frame to firstFrameCpp.ppm
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
picked geometry [instance: 0000000000000000, model: 0000000000000000, primitive: 4294967295]
```

7. Review GPU generated output images like steps 4. and 5. above.

### macOS

1. Start a new Terminal session.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions RenderingToolkit/GettingStarted/01_ospray_gsg/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
"languages": [{"cpp":{}}],
"dependencies": ["tbb","ospray","openvkl","embree","rkcommon","oidn"],
"os":["linux", "windows", "darwin"],
"targetDevice": ["CPU"],
"targetDevice": ["CPU","GPU"],
"ciTests": {
"linux": [
{
"id": "Intel_OSPRay_ospTutorial_lin",
"steps": [
"mkdir build",
"cd build",
"cmake ..",
"cmake --build . ",
"./ospTutorialCpp"
"cmake -DCMAKE_BUILD_TYPE=Release ..",
"cmake --build .",
"./ospTutorialCpp",
"./ospTutorialCpp --osp:load-modules=gpu --osp:device=gpu"
]
}
],
Expand All @@ -30,7 +31,8 @@
"cmake ..",
"cmake --build . --config Release",
"cd Release",
".\\ospTutorialCpp.exe"
".\\ospTutorialCpp.exe",
".\\ospTutorialCpp.exe --osp:load-modules=gpu --osp:device=gpu"
]

}
Expand All @@ -43,6 +45,7 @@
"cd build",
"cmake ..",
"cmake --build . ",
"export DYLD_LIBRARY_PATH=${ONEAPI_ROOT}/lib && ./ospTutorialCpp",
"export DYLD_LIBRARY_PATH=${ONEAPI_ROOT}/openvkl/latest/lib:${ONEAPI_ROOT}/rkcommon/latest/lib:${ONEAPI_ROOT}/tbb/latest/lib:${ONEAPI_ROOT}/embree/latest/lib:${ONEAPI_ROOT}/oidn/latest/lib:${ONEAPI_ROOT}/ispc/latest/lib:${ONEAPI_ROOT}/ospray/latest/lib && ./ospTutorialCpp"
]
}
Expand Down