Error when using CPU: resource deadlock
I have installed Sionna on a AMD Ryzen 5 5600G CPU running on Windows 11 and am facing de problem shown on the screenshots below when running the RT Tutorial : "Error while loading "F:\DroneAPRegression\Sionna\fga.xml" (at line 11, col 3): resource deadlock would occur: resource deadlock would occur." It happens when trying to run both the Sionna models and the maps I loaded from Blender, which work properly on a Linux computer. Is there any configuration needed when using AMD processors/ am I doing something wrong during set up?
Hello @JuliaBorgesSilva,
There shouldn't be any issue with AMD processors, but this might be a filesystem or Windows 11-related issue. As far as I can tell, you are encountering a filesystem-related error when multiple threads are used to load the scene in parallel.
There were two new releases of Mitsuba last week, I'm wondering whether this is related. Could you try again by installing either:
pip install mitsuba===3.4.1
or
pip install mitsuba===3.4.0
If this doesn't fix it, could you please try replacing this line in your Sionna installation (sionna/sionna/rt/scene.py):
self._scene = mi.load_file(env_filename)
with:
self._scene = mi.load_file(env_filename, parallel=False)
Hello, Thank you for the help, the issue does seem to come from a file-system error, but the the message is still the same after updating Mitsuba and editing scene.py.:
RuntimeError: [xml.cpp:215] Error while loading "FGA_2_6.xml" (at line 39, col 4): resource deadlock would occur: resource deadlock would occur.
I have the same problem. I tried the solutions above but they do not solve my problem. It is possible that the problem comes from a bad combination of versions
Hello @PhilSoy,
This seems to be a Mitsuba-related issue. Does the following script work?
import mitsuba as mi
mi.set_variant("cuda_ad_rgb") # Or whichever variant you were using
scene = mi.load_file("path/to/file.xml")
print(scene)
If not, could you please open an issue describing the problem and sharing your full scene (XML file + meshes) on the Mitsuba repo.
Hello, The script works after modifying the second line, as follows:
import mitsuba as mi
#mi.set_variant("cuda_ad_rgb") # Or whichever variant you were using
mi.set_variant('scalar_rgb')
scene=mi.load_file("grenoble_center\grenoble_center.xml")
print(scene)
The scene is displayed without any error message Thanks, Philippe
Hello @PhilSoy,
Since Sionna does not use the scalar_rgb variant, I don't think this is helpful to narrow down the issue.
You need to set the variant to what was used when you encountered the problem when running Sionna. This will be either cuda_ad_rgb or llvm_ad_rgb.
With mi.set_variant('llvm_ad_rgb') I get the following error message (the one I am used to see with Sionna so far):
[xml.cpp:179] Error while loading "grenoble_center\grenoble_center.xml" (at line 8, col 3): resource deadlock would occur: resource deadlock would occur.
With mi.set_variant("cuda_ad_rgb"), I get:
ImportError: jit_init_thread_state(): the CUDA backend hasn't been initialized. Make sure to call jit_init(JitBackend::CUDA) to properly initialize this backend.
Thanks for checking. This is good since it means you can reproduce the issue with a minimal script. As mentioned earlier, could you then please open an issue describing the problem and sharing your full scene (XML file + meshes) on the Mitsuba repo.
Will do after checking the drjit and LLVM versions
I've revised the LLVM path and library versions, but still get the same problem when running my scene, which is attached below as well as the code:
For reference, here is @PhilSoy's issue on the Mitsuba repo: https://github.com/mitsuba-renderer/mitsuba3/issues/1105
@JuliaBorgesSilva, could you please try @PhilSoy's solution described in this comment: https://github.com/mitsuba-renderer/mitsuba3/issues/1105#issuecomment-1999041203
The solution described I my last post worked, but does not work anymore. I get again the same error messages and crashes. After restarting the kernel and running the script, the path to LLVM-C.dll is not found and the script stops. After running it a second time, I get the usual ‘resource deadlock…’. I don’t know what has changed since last week. The environment variable is set on Windows, as well as on Sypder (with the Tools/user environment variables), I also put a os.environ['DRJIT_LIBLLVM_PATH'] = 'C:/Program Files/LLVM/bin’ in the script.
As I was fed up with wasting time, I now use the Jupyterlab notebook, and no longer have the problem
Thanks for reporting back @PhilSoy. Glad to hear it works with Jupyterlab.
Do I understand correctly that previously, you were not running either Python scripts from the command line nor Jupyter / Jupyterlab notebooks, but running notebooks from Spyder? I don't think we've ever tested Spyder, it might affect the library resolution path (I don't know).
Please note that os.environ['DRJIT_LIBLLVM_PATH'] = 'C:/Program Files/LLVM/bin’ would be incorrect, since as you noticed the DRJIT_LIBLLVM_PATH environment variable should point directly to the LLVM DLL on Windows.
Yes, I was initially running a .py script on Spyder (not a notebook) You are right (my mistake), I copied os.environ['DRJIT_LIBLLVM_PATH'] = 'C:/Program Files/LLVM/bin’ from an old script. Sorry about that. I corrected it, but the problem was still there.