Welcome! Log In Create A New Profile

Advanced

Problem in running a task for the second time

Posted by suzukit 
Problem in running a task for the second time
November 23, 2021 10:26PM
Hi Jaewon and all,

I am facing a problem in a new PC (windows 10, Matlab 2020b, MonkeyLogic #2.2.21., connected to two displays via an Nvidia graphics card).

When I run a task (or Latency test, or Photodiode tuner) for the first time after launcing the MonkeyLogic, it works normally. However, after the completion of the task, whenever I try to run any tasks (or Latency test, or Photodiode tuner), MonkeyLogic freezes without displaying any error messages. The subject screen does appear but the control screen doesn't.
To run a task again, I need to re-launch Matlab and MonkeyLogic.

This problem doesn't happen when the PC is connected to only one display. I tried diferent pairs of displays, but the problem remained. Also, in another PC, tasks run normally with the same displays. I re-installed Matlab, MonkeyLogic and Nvidia drivers and also tried an older version of MonkeyLogic (#2.2.15.) and another graphics card, but none of them solved the issue (this PC doesn't have ports for onboard graphics).

I would appreciate if you could provide me with some suggestions or instructions.
Thank you.
Re: Problem in running a task for the second time
November 24, 2021 07:37AM
Try installing the latest video driver. Also switch to software OpenGL rendering and see if there is any difference.
Re: Problem in running a task for the second time
November 24, 2021 02:18PM
Hi Jaewon,

Thank you for the prompt response.
I tried the lastest Nvidia graphics drivers and switched OpenGL setting to software, but the problem persists.
Are there any other things I can try?
Re: Problem in running a task for the second time
November 25, 2021 05:29PM
This kind of issue was usually a problem of the NVIDIA driver. You already tried many things and the issue is specific to a particular computer, so I have no idea.

If you have time, try to locate where exactly in the code the problem occurs. It may help me find some workaround.
Re: Problem in running a task for the second time
November 26, 2021 10:48AM
I see, will try to identify the location. Thank you for the suggestions!
Re: Problem in running a task for the second time
January 03, 2022 01:33AM
Hi,

I've been having the exact same problem. ML works on our two computers (both connected to one monitor), but freezes on one laptop(one monitor) and one desktop computer(connected to three monitors).

I've tried to locate where this problem occurs in the code, and it's in 'mglcreatesubjectscreen.m' file, line 17.
mdqmex(1,1,adapter_no-1,color,int32(fallback_screen_size),logical(forced_fallback));
The code works fine up until this line, but it freezes when I run this line. I haven't been able to look into mdqmex function.

I've checked the inputs to this function, and inputs do not change for when ML freezes or when it does not.
Do you have any suggestions on how to manage this problem?

Thank you.
Re: Problem in running a task for the second time
January 03, 2022 01:09PM
It is probably because there is not enough video memory. What are the memory size of your video card and the screen resolutions of connected monitors?

I just made NIMH ML generate error messages better, instead of being frozen. Download the package again and see what error message it shows. The issue will not be fixed though, if the cause is the video memory shortage.

Try lowering the display resolution. If a low screen resolution mitigates the problem, you will need a new video card with larger memory.
Re: Problem in running a task for the second time
January 03, 2022 10:55PM
Hi,

I realized that I forgot to update on my case. In my case, the error happened at "create(Screen,MLConfig)" (#866, or #348 in latency test)@ monkeylogic.m. It may be the same location as molamola pointed out above.
As vender’s (Dell) diagnostic tests detected some unknown issues (as well as system memory defects) and the troubleshooting failed, the PC has been returned to the vender. These defects may be related to the problem I faced in MonkeyLogic, but I was not completely sure.
Re: Problem in running a task for the second time
January 04, 2022 01:06AM
>> It may be the same location as molamola pointed out above.

Yes, that is the same location.
Re: Problem in running a task for the second time
January 04, 2022 07:21PM
Hello,
Thank you for replying.
I've checked the graphics card of the laptops & desktops that we have in our lab, and it is as follows:

devices with no problem
1. Laptop 1: Intel(R) UHD Graphics 620
display 1920*1080

2. Desktop 1: NVIDIA GeForce GTX 1660 Ti - 6GB
display 2560*1080

3. Desktop 2: NVIDIA GeForce GTX 1650 - 4GB
display 2560 * 1080

—-
devices that freeze
1. Desktop 3: NVIDIA GeForce RTX 3080 - 10GB
display 1: 1920*1080
display 2: 1920*1080
=> I've also tried to lower the display resolutions (both to 1440*900), but it doesn't change the problem.

2. Laptop 2 : GeForce GTX 1650 - 4GB
display 1920*1080

Since the memory storage of the graphics driver for our desktop 3 is 10 GB, I don't think it's the storage problem.
I also tried downloading the new ML version as you suggested and when I tried running tasks with it, ML displays the following error message instead of freezing while trying to load the subject screen.



Error using mglcreatesubjectscreen (line 17)
mgl::InitD3D, RegisterClass (code: 0x582)

Error in mlscreen/create (line 65)
mglcreatesubjectscreen(MLConfig.SubjectScreenDevice,MLConfig.SubjectScreenBackground,MLConfig.FallbackScreenRect,MLConfig.ForcedUseOfFallbackScreen);

Error in monkeylogic/UIcallback (line 867)
create(Screen,MLConfig);

Error while evaluating UIControl Callback.



If you have any suggestions, please let me know.

Thanks!
Re: Problem in running a task for the second time
January 04, 2022 08:13PM
I agree that it does not seem a video memory problem, but then I have no idea why it happens. Try updating the video driver to the most recent version from the NVIDIA homepage.

I actually removed the RegisterClass message, because that was not what I was looking for. Please download the package again and try again.
Re: Problem in running a task for the second time
January 05, 2022 02:22AM
I downloaded the package again, and the same problem remains (the subject screen freezes without displaying any error messages, and only when I run the task for the second time).
I've also done few more tests like suzukit. As suzukit said, this problem doesn't occur when the same desktop is connected to only one monitor, but occurs when it is connected to two or more monitors (no matter what combinations of monitors they are).
Since this problem only occurs when I'm running the ML task for the second time, my lab member and I were thinking of maybe finding a way to circumvent this problem by creating a code that restarts ML whenever we run the ML task for the second time or higher. But it seems that restarting ML doesn't really fix the problem (subject screen still freezes when we close and reopen ML app after running a task for the first time), and the only way is to restart Matlab over, which will be hard to implement.
For now, I guess the only way is to find computer(s) that works even with multiple monitors connected to it and switch it with my current desktop. Even so, please let me know if you find a way to solve/circumvent this issue. I will also keep you updated if something comes up.

Thank you.
Re: Problem in running a task for the second time
January 05, 2022 04:03AM
Thanks for the update. If you are willing to help with further testing, please download the package again and see if there is any difference.
Re: Problem in running a task for the second time
January 06, 2022 02:24AM
Hi Jaewon, thank you for looking into this.
I've tried the new version, but sadly the problem still remains on the same desktop.
I will let you know if anything comes up.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.