Skip to content

Commit 10e8356

Browse files
committed
Remove oidn external executable (rely only on internal oidn)
1 parent 4802c3b commit 10e8356

File tree

4 files changed

+53
-104
lines changed

4 files changed

+53
-104
lines changed

build-system/luxmake/wheel.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ def make_wheel(args):
167167
wheeltree / "pyluxcore.libs",
168168
dirs_exist_ok=True,
169169
)
170-
oidn_path = INSTALL_DIR / "pyluxcore.oidn"
171-
oidn_path.mkdir(parents=True, exist_ok=True)
172-
shutil.copytree(
173-
INSTALL_DIR / "pyluxcore.oidn",
174-
wheeltree / "pyluxcore.oidn",
175-
dirs_exist_ok=True,
176-
)
177170

178171
# Pack wheel
179172
logger.info("Packing wheel")

build-system/luxmake/windows.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ def win_recompose(args):
5151
namever = parsed_filename.group("namever")
5252
unpacked_wheel_path = Path(tmpdir) / namever
5353

54-
# Rename and move oidnDenoise
55-
logger.info("Renaming oidnDenoise.pyd into oidnDenoise.exe")
56-
_rename(unpacked_wheel_path, "oidnDenoise.pyd", "oidnDenoise.exe")
57-
5854
# Rename and move OpenImageDenoise_device_cpu
5955
logger.info(
6056
"Renaming OpenImageDenoise_device_cpu.pyd "

python/pyluxcoretest/pyluxcoretest.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -843,45 +843,6 @@ def convert_folder_to_windows(folder, extension):
843843

844844
# print(path_in_str, flush=True)
845845

846-
def ExternalOidn():
847-
print("*** External denoiser test ***")
848-
print(f"Looking for oidnDenoiser... ", end='')
849-
denoiser_path = pyluxcore.which_oidn()
850-
assert denoiser_path
851-
print("Found!")
852-
os.chdir(os.path.dirname(denoiser_path))
853-
854-
if platform.system() == "Linux":
855-
cmd = ["patchelf", denoiser_path, "--print-rpath"]
856-
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
857-
print("oidnDenoiser rpath:", result.stdout)
858-
859-
print("Running external denoiser")
860-
image_path = Path(__file__).parent / "memorial.pfm"
861-
args = [
862-
denoiser_path,
863-
"-hdr",
864-
image_path,
865-
]
866-
denoiser_process = subprocess.Popen(
867-
args,
868-
stdout=subprocess.PIPE,
869-
stderr=subprocess.STDOUT,
870-
text=True,
871-
env={"LD_DEBUG": "libs"},
872-
)
873-
with denoiser_process.stdout as d_out:
874-
if d_out:
875-
print("Denoiser output:")
876-
for line in d_out:
877-
print(line, end='')
878-
denoiser_process.wait()
879-
returncode = denoiser_process.returncode
880-
print("Denoiser return code:", returncode)
881-
assert returncode is not None and returncode == 0
882-
print()
883-
884-
885846
def main():
886847
"""Entry point."""
887848
print("STARTING LUXCORETEST", flush=True)
@@ -913,7 +874,6 @@ def main():
913874
ImagePipelineEdit()
914875
# SaveResumeRenderingS()
915876
# SaveResumeRenderingM()
916-
ExternalOidn()
917877

918878
print("Copying results", flush=True)
919879

src/pyluxcore/CMakeLists.txt

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -82,50 +82,50 @@ if(APPLE)
8282
endif()
8383
endif()
8484

85-
# OIDN
86-
# oidnDenoise
87-
add_executable(oidn-denoise IMPORTED)
88-
set_property(TARGET oidn-denoise PROPERTY IMPORTED_LOCATION "${LUX_OIDN_DENOISE_PATH}")
89-
90-
if(WIN32)
91-
# Windows lacks rpath system, so we have to put oidnDenoise in the same
92-
# folder as the dlls...
93-
set(OIDN_DESTINATION "pyluxcore.libs")
94-
else()
95-
# For Macos, reminder: don't put it in pyluxcore/.dylibs, it would prevent
96-
# other deps' relocation
97-
set(OIDN_DESTINATION "pyluxcore.oidn")
98-
endif(WIN32)
85+
## OIDN
86+
## oidnDenoise
87+
#add_executable(oidn-denoise IMPORTED)
88+
#set_property(TARGET oidn-denoise PROPERTY IMPORTED_LOCATION "${LUX_OIDN_DENOISE_PATH}")
89+
90+
#if(WIN32)
91+
## Windows lacks rpath system, so we have to put oidnDenoise in the same
92+
## folder as the dlls...
93+
#set(OIDN_DESTINATION "pyluxcore.libs")
94+
#else()
95+
## For Macos, reminder: don't put it in pyluxcore/.dylibs, it would prevent
96+
## other deps' relocation
97+
#set(OIDN_DESTINATION "pyluxcore.oidn")
98+
#endif(WIN32)
9999

100100
if(LINUX)
101-
set_property(
102-
TARGET oidn-denoise
103-
PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../pyluxcore.libs"
104-
)
101+
#set_property(
102+
#TARGET oidn-denoise
103+
#PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../pyluxcore.libs"
104+
#)
105105
install(
106106
PROGRAMS "${LUX_OIDN_DEVICE_CPU}"
107107
DESTINATION "pyluxcore.libs"
108108
COMPONENT pyluxcore
109109
)
110110
endif(LINUX)
111111

112-
if(APPLE)
113-
set_target_properties(
114-
oidn-denoise PROPERTIES
115-
INSTALL_RPATH "\\\${ORIGIN}/../pyluxcore/.pylibs"
116-
BUILD_RPATH ""
117-
)
118-
endif(APPLE)
119-
120-
INSTALL(
121-
IMPORTED_RUNTIME_ARTIFACTS oidn-denoise
122-
DESTINATION ${OIDN_DESTINATION}
123-
PERMISSIONS
124-
OWNER_WRITE OWNER_READ OWNER_EXECUTE
125-
GROUP_READ GROUP_EXECUTE
126-
WORLD_READ WORLD_EXECUTE
127-
COMPONENT pyluxcore
128-
)
112+
#if(APPLE)
113+
#set_target_properties(
114+
#oidn-denoise PROPERTIES
115+
#INSTALL_RPATH "\\\${ORIGIN}/../pyluxcore/.pylibs"
116+
#BUILD_RPATH ""
117+
#)
118+
#endif(APPLE)
119+
120+
#INSTALL(
121+
#IMPORTED_RUNTIME_ARTIFACTS oidn-denoise
122+
#DESTINATION ${OIDN_DESTINATION}
123+
#PERMISSIONS
124+
#OWNER_WRITE OWNER_READ OWNER_EXECUTE
125+
#GROUP_READ GROUP_EXECUTE
126+
#WORLD_READ WORLD_EXECUTE
127+
#COMPONENT pyluxcore
128+
#)
129129

130130

131131
if(WIN32)
@@ -139,24 +139,24 @@ if(WIN32)
139139
COMPONENT pyluxcore
140140
)
141141

142-
# Delvewheel doesn't handle executables, however we need to delocate oidnDenoise.
143-
# Therefore we had to let Delvewheel believe oidnDenoise is a lib, and now
144-
# we have to make it an executable again...
145-
message(STATUS "oidnDenoise suffix back to pyd")
146-
INSTALL(
147-
CODE
148-
"
149-
MESSAGE(STATUS
150-
\"Renaming '$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.exe' \
151-
into '$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.pyd'\"
152-
)
153-
FILE(RENAME
154-
$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.exe
155-
$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.pyd
156-
)
157-
"
158-
COMPONENT pyluxcore
159-
)
142+
## Delvewheel doesn't handle executables, however we need to delocate oidnDenoise.
143+
## Therefore we had to let Delvewheel believe oidnDenoise is a lib, and now
144+
## we have to make it an executable again...
145+
#message(STATUS "oidnDenoise suffix back to pyd")
146+
#INSTALL(
147+
#CODE
148+
#"
149+
#MESSAGE(STATUS
150+
#\"Renaming '$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.exe' \
151+
#into '$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.pyd'\"
152+
#)
153+
#FILE(RENAME
154+
#$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.exe
155+
#$<INSTALL_PREFIX>/pyluxcore.libs/oidnDenoise.pyd
156+
#)
157+
#"
158+
#COMPONENT pyluxcore
159+
#)
160160

161161
endif(WIN32)
162162

0 commit comments

Comments
 (0)