Skip to content

Commit 90d5360

Browse files
IRTK 2024.0 Changes for OSPray 3.0: GPU, Build, README, examples, validation, no src (#2016)
Signed-off-by: MichaelRoyceCarroll <michael.carroll@alumni.usc.edu> Co-authored-by: MichaelRoyceCarroll <michael.carroll@alumni.usc.edu>
1 parent 497d8a8 commit 90d5360

File tree

7 files changed

+92
-30
lines changed

7 files changed

+92
-30
lines changed

RenderingToolkit/GettingStarted/01_ospray_gsg/CMakeLists.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ if(DEFINED ENV{ONEAPI_ROOT})
66
set(ONEAPI_ROOT "$ENV{ONEAPI_ROOT}")
77
message(STATUS "ONEAPI_ROOT FROM ENVIRONMENT: ${ONEAPI_ROOT}")
88
else()
9-
if(WIN32)
10-
set(ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI")
11-
else()
12-
set(ONEAPI_ROOT /opt/intel/oneapi)
13-
endif()
14-
message(STATUS "ONEAPI_ROOT DEFAULT: ${ONEAPI_ROOT}")
9+
message(FATAL_ERROR "ONEAPI_ROOT NOT set. Please source environment variables.")
1510
endif(DEFINED ENV{ONEAPI_ROOT})
1611

17-
list(APPEND CMAKE_PREFIX_PATH "${ONEAPI_ROOT}/rkcommon/latest")
18-
find_package(ospray REQUIRED PATHS ${ONEAPI_ROOT})
12+
set(RKCOMMON_BASE_PATH "")
13+
set(OSPRAY_BASE_PATH "")
14+
if(EXISTS ${ONEAPI_ROOT}/oneapi-vars.sh OR EXISTS ${ONEAPI_ROOT}/oneapi-bars.bat)
15+
set(RKCOMMON_BASE_PATH "${ONEAPI_ROOT}")
16+
set(OSPRAY_BASE_PATH "${ONEAPI_ROOT}")
17+
else()
18+
set(RKCOMMON_BASE_PATH "${ONEAPI_ROOT}/rkcommon/latest")
19+
set(OSPRAY_BASE_PATH "${ONEAPI_ROOT}/ospray/latest")
20+
endif(EXISTS ${ONEAPI_ROOT}/oneapi-vars.sh OR EXISTS ${ONEAPI_ROOT}/oneapi-bars.bat)
21+
22+
list(APPEND CMAKE_PREFIX_PATH "${RKCOMMON_BASE_PATH}")
23+
find_package(ospray REQUIRED PATHS ${OSPRAY_BASE_PATH})
1924

2025
if(MSVC)
2126
set(CMAKE_CXX_STANDARD 11)
@@ -26,7 +31,7 @@ else()
2631
endif(MSVC)
2732

2833
include_directories(${OSPRAY_INCLUDE_DIR} ${RKCOMMON_INCLUDE_DIRS})
29-
link_directories(${OSPRAY_ROOT}/lib ${ONEAPI_ROOT}/rkcommon/latest/lib)
34+
link_directories(${OSPRAY_ROOT}/lib ${RKCOMMON_BASE_PATH}/lib)
3035

3136
add_executable(ospTutorialCpp ${OSPRAY_RESOURCE} src/ospTutorial.cpp)
3237
target_link_libraries(ospTutorialCpp PRIVATE ospray rkcommon)

RenderingToolkit/GettingStarted/01_ospray_gsg/README.md

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Getting Started Sample for Intel&reg; oneAPI Rendering Toolkit (Render Kit): Intel&reg; OSPRay
1+
# Getting Started Sample for Intel&reg; Rendering Toolkit (Render Kit): Intel&reg; OSPRay
22

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

99
| Minimum Requirements | Description
1010
|:--- |:---
11-
| OS | Linux* Ubuntu* 18.04 <br>CentOS 8 (or compatible) <br>Windows* 10 <br>macOS* 10.15+
11+
| OS | Linux* Ubuntu* 22.04 <br>CentOS 8 (or compatible) <br>Windows* 10 or 11<br>macOS* 10.15+
1212
| 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)
13-
| 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*
14-
| 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
13+
| 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*
14+
| 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
1515
| Image Display Tool | A .ppm filetype viewer (for example, [ImageMagick](https://www.imagemagick.org)).
1616

1717

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

5353
## Build and Run
5454

55-
### Additional Notes
56-
57-
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.
58-
59-
https://community.intel.com/t5/Intel-oneAPI-Rendering-Toolkit/2023-1-troubleshoot-errata-CMake-Error/m-p/1476040#M98
6055
### Windows
6156

62-
1. Run a new **x64 Native Tools Command Prompt for MSVS 2019**.
57+
1. Run a new **x64 Native Tools Command Prompt for MSVS 2022**.
6358

6459
```
6560
call <path-to-oneapi-folder>\setvars.bat
@@ -69,21 +64,45 @@ cd build
6964
cmake ..
7065
cmake --build . --config Release
7166
cd Release
72-
ospTutorialCpp.exe
67+
.\ospTutorialCpp.exe
68+
```
69+
2. Example stdout output:
70+
```
71+
rendering initial frame to firstFrameCpp.ppm
72+
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
73+
picked geometry [instance: 0000028FEA8F9860, model: 0000028FEA8CAE50, primitive: 1]
7374
```
7475

75-
2. Review the first output image with a .ppm image viewer. Example using
76+
3. Review the first output image with a .ppm image viewer. Example using
7677
ImageMagick display:
7778
```
7879
<path-to-ImageMagick>\imdisplay.exe firstFrameCpp.ppm
7980
```
8081

81-
3. Review the accumulated output image with a .ppm image viewer. Example using
82+
4. Review the accumulated output image with a .ppm image viewer. Example using
8283
ImageMagick display:
8384
```
8485
<path-to-ImageMagick>\imdisplay.exe accumulatedFrameCpp.ppm
8586
```
8687

88+
5. GPU (Beta in 2024.0) users try running the application in GPU mode:
89+
```
90+
REM close imdisplay and delete get started images
91+
del firstFrameCpp.ppm
92+
del AccumulatedFrameCpp.ppm
93+
REM run program
94+
.\ospTutorialCpp.exe
95+
96+
```
97+
98+
6. Review stdout output. Notice, picking `ospPick(..)` functionality is not available on GPU in the initial Intel&reg; OSPray 3.0 release:
99+
```
100+
rendering initial frame to firstFrameCpp.ppm
101+
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
102+
picked geometry [instance: 0000000000000000, model: 0000000000000000, primitive: 4294967295]
103+
```
104+
105+
7. Review GPU generated output images like steps 4. and 5. above.
87106

88107
### Linux
89108

@@ -98,17 +117,44 @@ cmake --build .
98117
./ospTutorialCpp
99118
```
100119

101-
2. Review the first output image with a .ppm image viewer. Example using
120+
2. Example stdout output:
121+
```
122+
rendering initial frame to firstFrameCpp.ppm
123+
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
124+
picked geometry [instance: 0000028FEA8F9860, model: 0000028FEA8CAE50, primitive: 1]
125+
```
126+
127+
3. Review the first output image with a .ppm image viewer. Example using
102128
ImageMagick display:
103129
```
104130
<path-to-ImageMagick>/display-im6 firstFrameCpp.ppm
105131
```
106132

107-
3. Review the accumulated output image with a .ppm image viewer. Example using
133+
4. Review the accumulated output image with a .ppm image viewer. Example using
108134
ImageMagick display:
109135
```
110136
<path-to-ImageMagick>/display-im6 accumulatedFrameCpp.ppm
111137
```
138+
139+
5. GPU (Beta in 2024.0) users try running the application in GPU mode:
140+
```
141+
# close display-im6 and delete get started images
142+
rm firstFrameCpp.ppm
143+
rm AccumulatedFrameCpp.ppm
144+
# run program
145+
./ospTutorialCpp
146+
147+
```
148+
149+
6. Review stdout output. Notice, picking `ospPick(..)` functionality is not available on GPU in the initial Intel&reg; OSPray 3.0 release:
150+
```
151+
rendering initial frame to firstFrameCpp.ppm
152+
rendering 10 accumulated frames to accumulatedFrameCpp.ppm
153+
picked geometry [instance: 0000000000000000, model: 0000000000000000, primitive: 4294967295]
154+
```
155+
156+
7. Review GPU generated output images like steps 4. and 5. above.
157+
112158
### macOS
113159

114160
1. Start a new Terminal session.
206 KB
Loading

RenderingToolkit/GettingStarted/01_ospray_gsg/example_images/accumulatedFrameCpp.ppm

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.
45.3 KB
Loading

RenderingToolkit/GettingStarted/01_ospray_gsg/example_images/firstFrameCpp.ppm

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

RenderingToolkit/GettingStarted/01_ospray_gsg/sample.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
"languages": [{"cpp":{}}],
88
"dependencies": ["tbb","ospray","openvkl","embree","rkcommon","oidn"],
99
"os":["linux", "windows", "darwin"],
10-
"targetDevice": ["CPU"],
10+
"targetDevice": ["CPU","GPU"],
1111
"ciTests": {
1212
"linux": [
1313
{
1414
"id": "Intel_OSPRay_ospTutorial_lin",
1515
"steps": [
1616
"mkdir build",
1717
"cd build",
18-
"cmake ..",
19-
"cmake --build . ",
20-
"./ospTutorialCpp"
18+
"cmake -DCMAKE_BUILD_TYPE=Release ..",
19+
"cmake --build .",
20+
"./ospTutorialCpp",
21+
"./ospTutorialCpp --osp:load-modules=gpu --osp:device=gpu"
2122
]
2223
}
2324
],
@@ -30,7 +31,8 @@
3031
"cmake ..",
3132
"cmake --build . --config Release",
3233
"cd Release",
33-
".\\ospTutorialCpp.exe"
34+
".\\ospTutorialCpp.exe",
35+
".\\ospTutorialCpp.exe --osp:load-modules=gpu --osp:device=gpu"
3436
]
3537

3638
}
@@ -43,6 +45,7 @@
4345
"cd build",
4446
"cmake ..",
4547
"cmake --build . ",
48+
"export DYLD_LIBRARY_PATH=${ONEAPI_ROOT}/lib && ./ospTutorialCpp",
4649
"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"
4750
]
4851
}

0 commit comments

Comments
 (0)