rgl-epfl / differentiable-sdf-rendering

Source code for "Differentiable Signed Distance Function Rendering" (Siggraph 2022)
BSD 3-Clause "New" or "Revised" License
861 stars 53 forks source link

Can not run with 'cuda_ad_rgb' backend #4

Closed Selozhd closed 2 years ago

Selozhd commented 2 years ago

I am following the example script in optimize.py. I can run with cpu no problem: python optimize.py dragon --optconfig no-tex-12 --llvm However, when I try with gpu, I get an error: python optimize.py dragon --optconfig no-tex-12 Segmentation fault (core dumped)

I can run mitsuba on gpu backend with no problems, so I think this has nothing to do with mitsuba:

>>> import mitsuba as mi
>>> mi.set_variant('cuda_ad_rgb')
>>> mi.cuda_ad_rgb.Point2d([2]).IsCUDA
True

FYI: I am running on ubuntu 20.04, Driver Version: 515.48.07, CUDA Version: 11.7

dvicini commented 2 years ago

Hi, that is strange, I am also using Ubuntu and the same driver version. Can you localize the segfault? (using coredumpctl debug). Could it be that there is a problem with the Eikonal solver? Can you run the following file using use_cuda = True? https://github.com/rgl-epfl/fastsweep/blob/main/python/example.py

Selozhd commented 2 years ago

I am not sure if I am using coredumpctl debug correctly but the output is:

           PID: 6426 (python)
       Message: Process 6426 (python) of user 1000 dumped core.
Executable: /home/paperspace/.pyenv/versions/3.10.4/bin/python3.10

                Stack trace of thread 6426:
                #0  0x0000000000000000 n/a (n/a + 0x0)
                #1  0x0000000000000000 n/a (n/a + 0x0)
                #2  0x00007ffccc816240 n/a (n/a + 0x0)

Here is the result from the script: example

Finally, after playing with the code a little, I realised that the segfault comes in line 56 render_reference_images() before optimize() is called.

Selozhd commented 2 years ago

I finally managed to fix the problem by reinstalling cuda. It seems the problem was about cuda to begin with. Anyway, thank you for the help!

dvicini commented 2 years ago

Awesome, happy to hear it worked out! FYI, the whole project should not require CUDA to even be installed. Both Mitsuba/Dr.Jit and my fastsweep package dynamically look up CUDA functionality using the driver API . As long as a reasonable recent Nvidia driver is installed, it should "just work".