I updated DSI Studio (will be ready in an hour) and you may check to
see if it solves the bad allocation problem.
Best,
Frank
On Sat, Aug 30, 2025 at 8:17 PM Frank Yeh <
fran...@gmail.com> wrote:
>
> Thanks for the tips to handle this issue.
>
> I will see what I can do on my side to avoid this in the future.
>
> For the memory issue, it is due to a lookup table to speed up the distance check. I can add a code to check if it is too large to avoid bad allocation.
>
> I will come up with a quick fix in one day or two.
>
> Best
> Frank
>
>> 1) Fixing DSI Studio Black Screen Issue
>> I use DSI Studio almost exclusively CLI, but for other users I document attempts to get GUI working below. I managed to get it working, but with some workarounds. Hopefully it's useful to some.
>> Following your advice for black screen, I updated my NVIDIA drivers. This made no change and black screen persisted.
>>
>> However, just for documentation, I then checked if acceleration was a problem by setting to use software rendering: `LIBGL_ALWAYS_SOFTWARE=1 ./dsi_studio
>> Result: quick fix. But perhaps not permanent solution. Best to upgrade Ubuntu 20 to 22+, otherwise...
>>
>> I suspect the issue resides in the use of WSL2 and Ubuntu 20.04. Wayland is outdated (≥1.20 required) and Qt6 is unavailable out-of-the-box for Ubuntu 20.04.
>> Hence:
>> `QT_QPA_PLATFORM=wayland ./dsi_studio` does not show DSI Studio at all.
>> `QT_QPA_PLATFORM=xcb ./dsi_studio` is the black screen problem.
>>
>> A more permanent fix/bypass:
>> We can bypass WSLg by using an external X server (like we did for WSL1): I use XLaunch (
https://sourceforge.net/projects/vcxsrv/).
>> 1) I start up XLaunch app with native openGL selected and disable access control.
>> 2) Inside WSL2: `export DISPLAY=$(hostname).local:0 && export LIBGL_ALWAYS_INDIRECT=0`
>> 3) If you run `glxgears` you should see moving gears. If you see moving gears, WSLg is now bypassed and handled via X server.
>> 4) Now if you launch DSI Studio `./dsi_studio` and load a .fib, it should work fine.
>>
>> 2) bad_alloc issues for small delete_repeat values
>> Thanks, Frank. I managed to implement a Python version that (loosely) follows your C++ logic. It seems to overcome memory demands by batching, but despite use of multiprocessing it will never be faster than a similar solution in C++. As you've now got a working solution I suppose this is low priority for you, but if there's a way to avoid memory overload in the C++ function it would be very appreciated.
>>
>> Kind regards