klabhub / neurostim

Design and run visual neuroscience experiments using Matlab and the Psychophysics Toolbox.
MIT License
5 stars 4 forks source link

CPU releases in ITI, leading to frame drops under certain conditions #134

Closed adammorrissirrommada closed 12 months ago

adammorrissirrommada commented 4 years ago

Computation on the first frame or two of each trial (except trial 1) was sluggish and erratic on my Windows 10 machine: returning a very large matrix from rand() in beforeFrame() had huge variability, with particularly long calls occasionally (causing frame drops). It seemed to be due to the CPU being allowed to do non-NS things during the ITI. (https://github.com/klabhub/neurostim-ptb/commit/c3eebde31d9a8a25db3683a23b6261dad7bcc796) is an initial commit of a temporary fix, mostly as a placeholder to remind us to fix it properly. I just added some load to the CPU during the ITI to keep priority. rand() was much faster and more consistent with this fix.

@bartkrekelberg, any thoughts? Is this a problem worth solving?

duijnhouwer commented 4 years ago

What if you run Neurostim with Windows Gamemode? Might keep it prioritized

On Thu, Oct 24, 2019, 22:37 Adam Morris notifications@github.com wrote:

Computation on the first frame or two of each trial (except trial 1) was sluggish and erratic on my Windows 10 machine: returning a very large matrix from rand() in beforeFrame() had huge variability, with particularly long calls occasionally (causing frame drops). It seemed to be due to the CPU being allowed to do non-NS things during the ITI. (c3eebde https://github.com/klabhub/neurostim-ptb/commit/c3eebde31d9a8a25db3683a23b6261dad7bcc796) is an initial commit of a temporary fix, mostly as a placeholder to remind us to fix it properly. I just added some load to the CPU during the ITI to keep priority. rand() was much faster and more consistent with this fix.

@bartkrekelberg https://github.com/bartkrekelberg, any thoughts? Is this a problem worth solving?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/klabhub/neurostim-ptb/issues/134?email_source=notifications&email_token=ACZ6C6E532C5ZRDRFA7Z3GLQQJLVTA5CNFSM4JE5YCV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUIUI4Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6C6BQUJV6QCFOJOKU7FLQQJLVTANCNFSM4JE5YCVQ .

bartkrekelberg commented 4 years ago

Did you try not dropping the Priority() in the ITI? We do this to let the OS do some other stuff , but it may not be necessary...

B


From: Adam Morris notifications@github.com Sent: Friday, October 25, 2019 4:37 To: klabhub/neurostim-ptb neurostim-ptb@noreply.github.com Cc: Bart Krekelberg bart@vision.rutgers.edu; Mention mention@noreply.github.com Subject: [klabhub/neurostim-ptb] CPU releses in ITI, leading to frame drops under certain conditions (#134)

Computation on the first frame or two of each trial (except trial 1) was sluggish and erratic on my Windows 10 machine: returning a very large matrix from rand() in beforeFrame() had huge variability, with particularly long calls occasionally (causing frame drops). It seemed to be due to the CPU being allowed to do non-NS things during the ITI. (c3eebdehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fklabhub%2Fneurostim-ptb%2Fcommit%2Fc3eebde31d9a8a25db3683a23b6261dad7bcc796&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419327979&sdata=6IQEox60RUAHR%2Fxl15t7AeiMkybFD1DRFY78VL82Y%2F0%3D&reserved=0) is an initial commit of a temporary fix, mostly as a placeholder to remind us to fix it properly. I just added some load to the CPU during the ITI to keep priority. rand() was much faster and more consistent with this fix.

@bartkrekelberghttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbartkrekelberg&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419337948&sdata=Bsfp4VrKvsPl37JEjljwxgSvAeBgl5DGYFmnyeD%2B%2FoA%3D&reserved=0, any thoughts? Is this a problem worth solving?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fklabhub%2Fneurostim-ptb%2Fissues%2F134%3Femail_source%3Dnotifications%26email_token%3DAC3MRUYI5ICZOMLLYKQ6KGTQQJLVTA5CNFSM4JE5YCV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUIUI4Q&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419337948&sdata=x20VCYICmi1tUzcwT%2FVto9kun8YJ3fw15NnvDi%2Feggk%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC3MRU4CEMD5KUKOVOLGDZ3QQJLVTANCNFSM4JE5YCVQ&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419337948&sdata=U2rGyB%2BoQxKL0YQvoJXaIrubkOEDHrcn6u0d33r2aGQ%3D&reserved=0.

adammorrissirrommada commented 4 years ago

Yeah, pretty sure I tried that, had no effect.

On Fri., 25 Oct. 2019, 6:23 pm Bart Krekelberg, notifications@github.com<mailto:notifications@github.com> wrote: Did you try not dropping the Priority() in the ITI? We do this to let the OS do some other stuff , but it may not be necessary...

B


From: Adam Morris notifications@github.com<mailto:notifications@github.com> Sent: Friday, October 25, 2019 4:37 To: klabhub/neurostim-ptb neurostim-ptb@noreply.github.com<mailto:neurostim-ptb@noreply.github.com> Cc: Bart Krekelberg bart@vision.rutgers.edu<mailto:bart@vision.rutgers.edu>; Mention mention@noreply.github.com<mailto:mention@noreply.github.com> Subject: [klabhub/neurostim-ptb] CPU releses in ITI, leading to frame drops under certain conditions (#134)

Computation on the first frame or two of each trial (except trial 1) was sluggish and erratic on my Windows 10 machine: returning a very large matrix from rand() in beforeFrame() had huge variability, with particularly long calls occasionally (causing frame drops). It seemed to be due to the CPU being allowed to do non-NS things during the ITI. (c3eebdehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fklabhub%2Fneurostim-ptb%2Fcommit%2Fc3eebde31d9a8a25db3683a23b6261dad7bcc796&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419327979&sdata=6IQEox60RUAHR%2Fxl15t7AeiMkybFD1DRFY78VL82Y%2F0%3D&reserved=0) is an initial commit of a temporary fix, mostly as a placeholder to remind us to fix it properly. I just added some load to the CPU during the ITI to keep priority. rand() was much faster and more consistent with this fix.

@bartkrekelberghttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbartkrekelberg&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419337948&sdata=Bsfp4VrKvsPl37JEjljwxgSvAeBgl5DGYFmnyeD%2B%2FoA%3D&reserved=0, any thoughts? Is this a problem worth solving?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fklabhub%2Fneurostim-ptb%2Fissues%2F134%3Femail_source%3Dnotifications%26email_token%3DAC3MRUYI5ICZOMLLYKQ6KGTQQJLVTA5CNFSM4JE5YCV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUIUI4Q&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419337948&sdata=x20VCYICmi1tUzcwT%2FVto9kun8YJ3fw15NnvDi%2Feggk%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC3MRU4CEMD5KUKOVOLGDZ3QQJLVTANCNFSM4JE5YCVQ&data=02%7C01%7Cbart%40rutgers.edu%7Cfbab6d2ac0654f72fcaf08d758f4420f%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637075678419337948&sdata=U2rGyB%2BoQxKL0YQvoJXaIrubkOEDHrcn6u0d33r2aGQ%3D&reserved=0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/klabhub/neurostim-ptb/issues/134?email_source=notifications&email_token=AC3SMT3BWUBCA4YY24TJM33QQKNHTA5CNFSM4JE5YCV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECHONZA#issuecomment-546236132, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC3SMTZYY4CJICLLLHQLIKTQQKNHTANCNFSM4JE5YCVQ.