Skip to content

Commit 98bb0ab

Browse files
committed
RH-91240: crash on Rhino exit.
Disable OneAPI and SYCL8. Also: * make build script defensive * stop on PS errors * ask for confirmation before deleting * properly get debug version of openvdb when building debug build
1 parent 8e71bfc commit 98bb0ab

8 files changed

Lines changed: 46 additions & 19 deletions

File tree

build_all_cycles.ps1

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
$ErrorActionPreference = 'Stop'
2+
13
$cwd = $PSScriptRoot
24

35
$configs = @('Debug', 'Release')
@@ -13,14 +15,13 @@ foreach($buildConfig in $configs)
1315
$biglibs_location = (Convert-Path "$cwd\..\..\..\..\..\..\big_libs\RhinoCycles")
1416
$biglibs_kernel_location = (Convert-Path "$biglibs_location\lib")
1517
$biglibs_source_location = (Convert-Path "$biglibs_location\ccycles\source")
18+
New-Item -Type Directory -Force "$biglibs_location\ccycles\win\$lowerconfig"
1619
$biglibs_dll_location = (Convert-Path "$biglibs_location\ccycles\win\$lowerconfig")
1720
$local_build = (Convert-Path "$cwd\build_$lowerconfig")
1821
$local_install = (Convert-Path "$cwd\install_$lowerconfig")
1922
$local_install_release = (Convert-Path "$cwd\install_release")
2023
$local_install_debug = (Convert-Path "$cwd\install_debug")
2124

22-
#Remove-Item -Recurse -Force .\install
23-
2425
Push-Location $cwd
2526

2627
.\make_rhino.bat $lowerconfig all
@@ -88,15 +89,6 @@ foreach($buildConfig in $configs)
8889
$_.Name.ToLower() -notmatch 'o_2' `
8990
-and $_.Name.ToLower() -notmatch 'loader.dll'
9091
}
91-
# add back openvdb, since that is always linked as openvdb.dll
92-
$openvdb = (Convert-Path "$local_install_release\ccycles\openvdb.dll")
93-
$dependencies += Get-Item $openvdb
94-
# also need tbb12.dll
95-
$tbb12 = (Convert-Path "$local_install_release\ccycles\tbb12.dll")
96-
$dependencies += Get-Item $tbb12
97-
# and OpenColorIO_d_2_4.dll
98-
$oiio = (Convert-Path "$local_install_release\ccycles\OpenColorIO_d_2_4.dll")
99-
$dependencies += Get-Item $oiio
10092
}
10193
else {
10294
$dependencies = $deps | Where-Object {
@@ -107,12 +99,12 @@ foreach($buildConfig in $configs)
10799
}
108100
}
109101

110-
Remove-Item -Recurse -Force "$biglibs_kernel_location\*"
102+
Remove-Item -Confirm -Recurse -Force "$biglibs_kernel_location\*"
111103
Copy-Item -Recurse -Force "$local_install\lib\*" "$biglibs_kernel_location\."
112-
Remove-Item -Recurse -Force "$biglibs_source_location\*"
104+
Remove-Item -Confirm -Recurse -Force "$biglibs_source_location\*"
113105
Copy-Item -Recurse -Force "$local_install\source\*" "$biglibs_source_location\."
114106

115-
Remove-Item -Recurse -Force "$biglibs_dll_location\*"
107+
Remove-Item -Confirm -Recurse -Force "$biglibs_dll_location\*"
116108
foreach($dependency in $dependencies)
117109
{
118110
Write-Host "${buildConfig}: Copying $dependency"

make_rhino.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ if not "%ARG1%" == "cudabin" (
4949
)
5050
)
5151

52-
set BUILDING_ONEAPI="Yes"
52+
set BUILDING_ONEAPI="No"
5353
set BUILD_ONEAPI_CMD= ^
54-
-DWITH_CYCLES_DEVICE_ONEAPI=ON ^
55-
-DWITH_CYCLES_ONEAPI_BINARIES=ON ^
54+
-DWITH_CYCLES_DEVICE_ONEAPI=OFF ^
55+
-DWITH_CYCLES_ONEAPI_BINARIES=OFF ^
5656
-DMSVC_REDIST_DIR=%MSVC_REDIST_DIR% ^
5757
-DLEVEL_ZERO_INCLUDE_DIR=%LEVELZERO_INC% ^
5858
-DLEVEL_ZERO_LIBRARY=%LEVELZERO_LIB% ^
@@ -104,6 +104,7 @@ echo BUILDING CONFIG %CONFIG%
104104
if "%BUILDING%" == "Yes" (
105105
cmake -G Ninja -DCMAKE_BUILD_TYPE=%CONFIG% -B %BUILD_DIR% ^
106106
-DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% ^
107+
-DWITH_CYCLES_DEVICE_ONEAPI=OFF ^
107108
-DWITH_CYCLES_ALEMBIC=OFF ^
108109
-DWITH_CYCLES_USD=OFF ^
109110
-DWITH_CYCLES_OSL=OFF ^
@@ -116,7 +117,6 @@ if "%BUILDING%" == "Yes" (
116117
-DCUDA_NVCC_FLAGS=--allow-unsupported-compiler ^
117118
%BUILD_CUDA_CMD% ^
118119
%BUILD_CUDABIN_CMD% ^
119-
%BUILD_ONEAPI_CMD% ^
120120
%BUILD_HIP_CMD% ^
121121
&& cd %BUILD_DIR% && cmake --build . --target install --config %CONFIG%
122122
) else if "%COMMAND%" == "clean" (

src/ccycles/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ if(WITH_CYCLES_OSL)
4545
list(APPEND LIB cycles_kernel_osl)
4646
endif()
4747

48+
if(WITH_CYCLES_DEVICE_ONEAPI)
49+
list(APPEND LIB
50+
${SYCL_LIBRARIES}
51+
)
52+
list(APPEND INC_SYS
53+
${SYCL_INCLUDE_DIR}
54+
)
55+
endif()
56+
4857
if(CYCLES_STANDALONE_REPOSITORY)
4958
list(APPEND LIB extern_sky)
5059
else()

src/ccycles/ccycles.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,10 @@ CCL_CAPI void cycles_initialise(unsigned int mask)
721721
}
722722
}
723723

724+
CCL_CAPI void cycles_shutdown()
725+
{
726+
}
727+
724728
CCL_CAPI unsigned int cycles_number_devices()
725729
{
726730
return static_cast<unsigned int>(devices.size());

src/ccycles/internal_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ namespace fs = std::filesystem;
8282
#include <OpenImageIO/imagebufalgo.h>
8383
#include <OpenImageIO/ustring.h>
8484

85+
#if WITH_ONEAPI
86+
#include <sycl/sycl.hpp>
87+
#endif
88+
8589
using OIIO::ustring;
8690

8791
#pragma warning ( pop )

src/cmake/Modules/FindOpenVDB.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ find_path(OPENVDB_INCLUDE_DIR
3838
include
3939
)
4040

41+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
42+
find_library(OPENVDB_LIBRARY
43+
NAMES
44+
openvdb_d
45+
HINTS
46+
${_openvdb_SEARCH_DIRS}
47+
PATH_SUFFIXES
48+
lib64 lib
49+
)
50+
else()
4151
find_library(OPENVDB_LIBRARY
4252
NAMES
4353
openvdb
@@ -46,6 +56,7 @@ find_library(OPENVDB_LIBRARY
4656
PATH_SUFFIXES
4757
lib64 lib
4858
)
59+
endif()
4960

5061
# handle the QUIETLY and REQUIRED arguments and set OPENVDB_FOUND to TRUE if
5162
# all listed variables are TRUE

src/cmake/external_libs.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ else()
7878
message(FATAL_ERROR "Unsupported platform for Rhino")
7979
endif()
8080

81-
set(_cycles_lib_dir "${_top_source_dir}/${_cycles_lib_platform}")
81+
string(TOLOWER ${CMAKE_BUILD_TYPE} _build_config)
82+
if(_build_config STREQUAL "relwithdebinfo")
83+
set(_build_config "release")
84+
endif()
85+
86+
set(_cycles_lib_dir "${_top_source_dir}${_cycles_lib_platform}/${_build_config}")
8287

8388
# Use legacy libraries for compatibility with Houdini or USD without oneTBB.
8489
set(_cycles_lib_dir_legacy "${_top_source_dir}/lib/legacy/${_cycles_lib_platform}")

src/kernel/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ if(WITH_CYCLES_CUDA_BINARIES)
470470
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${NVCC_OUT}")
471471
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
472472

473+
message(STATUS "have ${CUDA_NVCC_EXECUTABLE} and ${CUDAVERSION}")
474+
473475
# warn for other versions
474476
if((CUDA_VERSION STREQUAL "101") OR
475477
(CUDA_VERSION STREQUAL "102") OR

0 commit comments

Comments
 (0)