mitsuba-renderer / mitsuba3

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

Optix Denoiser Error #1019

Closed myaldiz closed 8 months ago

myaldiz commented 8 months ago

Summary

Hi there!

I am trying to run the denoiser explained in the tutorials. However I get the following error:

Critical Dr.Jit compiler failure: jit_optix_check(): API error 7990 (OPTIX_ERROR_INTERNAL_ERROR): "Internal error" in /project/src/render/optixdenoiser.cpp:38.

System configuration

I use docker container with pytorch/pytorch:2.1.2-cuda12.1-cudnn8-devel base image. I installed mitsuba using pip as described.

I use NVIDIA 3090ti.

Really appreciate your support if I am missing anything. Thank you!

njroussel commented 8 months ago

Hi @myaldiz

Does everything work as expected on the host system (without docker)?

Can you even render a simple scene in docker ? Here's a one-liner:

python -c "import mitsuba as mi; mi.set_variant('cuda_ad_rgb'); mi.Bitmap(mi.render(mi.load_dict(mi.cornell_box()))).write('tmp.exr')"

My initial guess is that this is due to your choice of docker image. I believe OptiX isn't shipped in most docker images and you should copy over the shared libraries from the host. OptiX and its denoiser needs 3 files: libnvoptix.so.*, libnvidia-rtcore.so.* nvoptix.bin.

Try running the OptiX SDK examples rather than mitsuba, at least we'll know if it is a Mitusba-specific issue.

merlinND commented 8 months ago

Issue #504 mentions Docker and OptiX, and the solution ended up having to do with the driver capabilities environment variable. The solution might be as simple as setting NVIDIA_DRIVER_CAPABILITIES=all.

myaldiz commented 8 months ago

I think nvoptix.bin missing in docker container, I mounted it and it works now, I use the following command to create the container:

docker run -it --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/host -v /usr/share/nvidia:/usr/share/nvidia --network=host -e NVIDIA_DRIVER_CAPABILITIES=all --privileged --runtime=nvidia --ipc=host mycontainer bash