mitsuba-renderer / mitsuba3

Mitsuba 3: A Retargetable Forward and Inverse Renderer
https://www.mitsuba-renderer.org/
Other
2.1k stars 246 forks source link

CUDA compile error with `prb_projective` using `'guiding': 'octree'` #1312

Open LinasBeres opened 2 months ago

LinasBeres commented 2 months ago

Summary

CUDA compile error with prb_projective using 'guiding': 'octree'.

Error:

Critical Dr.Jit compiler failure: jit_optix_compile(): optixModuleGetCompilationState() indicates that the compilation did not complete succesfully. The module's compilation state is: 0x2363

System configuration

System information:

OS: Fedora Linux 39 (Workstation Edition) CPU: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz GPU: NVIDIA GeForce GTX 1080 Python: 3.12.5 (main, Aug 7 2024, 00:00:00) [GCC 13.3.1 20240522 (Red Hat 13.3.1-1)] NVidia driver: 560.35.03 LLVM: 17.0.6

Dr.Jit: 0.4.6 Mitsuba: 3.5.2 Is custom build? False Compiled with: GNU 10.2.1 Variants: scalar_rgb scalar_spectral cuda_ad_rgb llvm_ad_rgb

Description

Created a simple test for the projective prb integrator where a wall is moved slightly and then try to optimise the position of the wall from a reference image.

Note that there is no error when using a grid or none as the guiding structure.

I can also provide the stderr if need be.

Steps to reproduce

Run the following program in the mitsuba 3 repo.

import os
import drjit as dr
import mitsuba as mi

mi.set_variant('cuda_ad_rgb')

scene = mi.load_file(os.path.join(os.getcwd(), 'tutorials/scenes/cbox.xml'))

image_ref = mi.render(scene)

params = mi.traverse(scene)
key = 'greenwall.vertex_positions'
initial_to_world = dr.unravel(mi.Point3f, params[key])

def apply_transformation(params, opt):
    opt['trans'] = dr.clamp(opt['trans'], -0.5, 0.5)

    trafo = mi.Transform4f.translate([opt['trans'].x, opt['trans'].y, opt['trans'].z])

    params[key] = dr.ravel(trafo @ initial_to_world)
    params.update()

opt = mi.ad.Adam(lr=0.025)
opt['trans'] = mi.Point3f(1,0,1)
apply_transformation(params, opt)

integrator = mi.load_dict({
    'type': 'prb_projective',
    'guiding': 'octree',
})

iteration_count = 20
for it in range(iteration_count):

    apply_transformation(params, opt)

    image = mi.render(scene, params, seed=it, integrator=integrator)

    loss = dr.sum(dr.sqr(image - image_ref)) / len(image)

    dr.backward(loss)

    opt.step()