Open ignamoro opened 3 years ago
Hi @naachoo0 ,
I am not sure to fully understand your problem here. Are you trying to switch between variants in your jupyter notebook using mitsuba.set_variant(...)
? This should be possible, it is used quite a few times in the test suite.
Maybe you could share a little more of your code so I could take a look and see what's going on?
The problem is that switch between variants from a custom module (where is mitsuba declared and used) is giving me problems, throwing mistakes.
For example, I have the following code, stored in [User]/miniconda3/Lib/customLibrary/mitsuba.py:
When I use from jupyter notebook the method _setVariant('[newvariant]') and then use getVariant(), this returns the variant that was inserted with setVariant, fine!. But the problem is that when I Try use like that new variant (e.g. rendering the scene like a scalar* variant using the code of the document), I get the error that I show in the previos post (cuda_var_register(): attempted to create a variable with size zero!).
Looks like internally, the switch was not made it and mitsuba is in the gpu* variable still.
Could it be that some variables where created (e.g. scene, Float, ...) when the gpu
variant was switched ON, and later on you are trying to use those same GPU variables with the scalar
variant ON?
For instance, you will need to reload the scene after switching variant.
I don't think so, because the variants are switched at the beginning of the code. I attached my code used in jupyter (I've turned .py for better code understanding)
My default variant is 'gpu_autodiff_rgb'
Set variant to 'scalar_spectral'
Now I should be using the 'scalar_spectral' variant
Reading the ('x', 'y', 'z') of element 'vertex' from file 'C:/Users/nacho/miniconda3/Lib/tfg/examples/cloudpoints/bunny.ply' Using 'scalar_spectral' variant
2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\path.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\perspective.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\hdrfilm.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\gaussian.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\multijitter.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\directional.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\uniform.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\sphere.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\diffuse.dll" .. 2021-02-04 11:58:12 INFO main [PluginManager] Loading plugin "plugins\srgb.dll" .. 2021-02-04 11:58:12 INFO main [Scene] Building scene in OptiX .. 2021-02-04 11:58:12 INFO main [SamplingIntegrator] Start rendering...
RuntimeError Traceback (most recent call last)
And I suppose this doesn't happen if you do not set the scalar_spectral
variant at the beginning? Why do you even need to do this in the first place?
Because I've thought about having mitsuba in a module to organize the code. The problem is when i have to specify which variant use from jupyter. Can you in python import a module by passing argument?
[🐛 bug report]
Description
Hi everyone, I'm trying to change the variant from main (notebook jupyter), using mitsuba from other module, but I don't know how to specify a certain variant when importing it, so I try to use the method setVariant( 'variant' ) for this propose. the problem is that when I try to change it, it shows that it is using this new variable (through getVariant()), but then it is not used, and uses the module's default
System configuration
For bug report, please enter information regarding your system configuration<- [remove this]
Steps to reproduce