CloudyDory / cudaica_win

CUDAICA on Windows
12 stars 4 forks source link

Error #3

Closed UgoBruzadin closed 1 year ago

UgoBruzadin commented 5 years ago

I'm having issues with the code and can't figure it out on my own. Could you help me? I'm running the code on matlab 2017a, Inter core i7 4702HQ CPU 2.20 GHz, 8gb ram Nvidia GTX 870M (razer 2014 laptop) I'm using your version because I have no idea how to compile the code (I tried installing the CUDA10 but it corrupted my windows and I had to reset it twice)

when I run via the GUI, the code runs ok, but it gives me the same elapsed time for any versions (runica, binica and cudaica). When I run the code via syntax, it doesn't run it at all giving this error:

tic EEG = pop_runica(EEG, 'extended',1,'icatype','cudaica','interupt','on','pca',29); toc Scaling components to RMS microvolt

Saving current ICA decomposition in "EEG.etc.oldicaweights" (etc.). Decomposition saved as entry 5. Attempting to convert data matrix to double precision for more accurate ICA results. cudaica: using source file 'C:\Program Files\MATLAB\R2017a\bin\eeglab14_1_2b\functions\sigprocfunc\binica.sc' cudaica(): using binary ica file 'C:\Program Files\MATLAB\R2017a\bin\eeglab14_1_2b\plugins\CudaICA1.0\cudaica_win.exe' cudaica(): processing 4 (flag, arg) pairs. setting lrate, 0.001 setting extended, 1 Reducing the data to 29 principal dimensions... setting pca, 29 scriptfile = cudaica7323.sc

cudaica(): ica script file cudaica7323.sc data C:\cudaica7323.fdt pwd C:.

Running ica from script file cudaica7323.sc Finding 29 components. 'C:\Program' is not recognized as an internal or external command, operable program or batch file. Output argument "A" (and maybe others) not assigned during call to "cudaica>floatread".

Error in cudaica (line 345) weights = floatread(weightsfile,[ncomps Inf],[],0,'double');

Error in pop_runica (line 436) [EEG.icaweights,EEG.icasphere] = cudaica(tmpdata, 'lrate', 0.001, g.options{:} );

UgoBruzadin commented 5 years ago

I managed to fix the binica error (same error) by substituting the "bin_linux" for the "binica.exe" in the icadefs.m, but can't fix the cudaica. I changed the folder of eeglab to a folder with no space in it (my past folder was Program Files), the problem persists.

UgoBruzadin commented 5 years ago

I fixed it. I was misunderstanding the instructions. I thought that the visual studio, cuda and mkl library were optional or just for recompiling. It works and it works fast! Any bug that I should be aware about? I’ll implement this in the lab and buy a few graphics cards. Thanks a lot for everything.

CloudyDory commented 5 years ago

Hello, thanks for your support for CUDAICA on Windows. I am very sorry for this late reply.

When adapting the original code to make it work under Windows, I have checked the code in detail, and to the best of my knowledge, I am sure that it use the same algorithm as in runica.m. Currently I am not aware of any bugs in the code, except for one place that need further verification, which is the batch size used in gradient descent algorithm.

The infomax ICA uses gradient descent algorithm to find the best transformation matrix. At each step the algorithm randomly picks a small chunk of data and calculate the change of transformation matrix. The size of this small chunk of data is the batch size. CUDAICA is fast because the original author used a relatively large batch size, compared to tunica.m, hence one can fully use the parallel computational capabilities of modern GPU. I have tried change the batch size to the same as runica.m, and it produced the same decomposition result as runica.m, but at the price of a much slower computing speed. A larger batch size produces very similar, but different result, yet I don’t know whether this difference is significant enough to affect further data processing.

Currently I am very much involved in another project, and I don’t think I have time to further investigate it. I think this is the only issue you should know before a large scale implementation.

The default block size setting in CUDAICA is at line 82 of config.h, and the default block size setting in runica.m is at line 168 and 169.

UgoBruzadin commented 5 years ago

Thank you so much for your response! I've benchmarked runica vs binica vs cudaica in windows and we didn't observe significant differences. Indeed, sometimes there are more differences within runica than between runica and cudaica or binica. So we're treating cudaica as the same as runica. Something is up with the PCA version of binica and it's driving me mad, I think you saw my email to the listserv. Thanks for the response by the way. At the moment we were planning on running a 30 PCA and then remove components on a 128 channel, but after reading and rereading that paper I realize that's really bad and we'll have to rethink it. I wanted to say I've installed the CUDAICA for windows in two computers with NVIDIA GPU's successfully, it works wonderfully with no bugs or errors! Almost creepy haha.

I'll play around with the block size and do some research on the topic. Thanks for informing this to me, it's very helpful to know what's going on behind the codes!

Best wishes, Ugo

jimkroger commented 5 years ago

Thank you so much for your response! I've benchmarked runica vs binica vs cudaica in windows and we didn't observe significant differences. Indeed, sometimes there are more differences within runica than between runica and cudaica or binica. So we're treating cudaica as the same as runica. Something is up with the PCA version of binica and it's driving me mad, I think you saw my email to the listserv. Thanks for the response by the way. At the moment we were planning on running a 30 PCA and then remove components on a 128 channel, but after reading and rereading that paper I realize that's really bad and we'll have to rethink it. I wanted to say I've installed the CUDAICA for windows in two computers with NVIDIA GPU's successfully, it works wonderfully with no bugs or errors! Almost creepy haha.

I'll play around with the block size and do some research on the topic. Thanks for informing this to me, it's very helpful to know what's going on behind the codes!

Best wishes, Ugo

Ugo, can you clarify a bit further. You said you installed the CUDAICA for windows on two computers with NVIDIA GPUs and it works wonderfully. Is it running as fast as as Fraimono’s original published version runs in Linux?

I'm confused because you say runica, binica, and cudaica are not significantly different. Of course, Fraimono’s original version shows VAST improvement compared to those under linux. Eager to hear your reply.

Maybe you mean the ICA results are the same for the three, not the speed?

You also talk about having to rethink things, so I'm trying to get an idea of what you are saying.

Thanks Jim

CloudyDory commented 5 years ago

I believe the things that Ugo was rethinking was this link, which I think is unrelated to CUDAICA here.

jimkroger commented 4 years ago

Hi, I have yet to get this working for me, other things to do…. I will watch to see how it goes.

From: miguelfernando55 notifications@github.com Reply-To: yhz-1995/cudaica_win reply@reply.github.com Date: Tuesday, June 9, 2020 at 8:18 AM To: yhz-1995/cudaica_win cudaica_win@noreply.github.com Cc: James Kroger jkroger@nmsu.edu, Comment comment@noreply.github.com Subject: Re: [yhz-1995/cudaica_win] Error (#3)

WARNING: This email originated external to the NMSU email system. Do not click on links or open attachments unless you are sure the content is safe.

Dear, I am having a problem running CudaICA. Kindly ask for help. I am try to run CudaICA on Matlab 2019a on Windows 10. My code stops at the cudaica.m line 340, wts = floatread(weightsfile,[ncomps Inf],[],0); It gives the error: 'cudaica' is not recognized as an internal or external command, operable program or batch file. I putted CUDAICABINARY = ['cudaica']; on icadefs.m file. Did I forgot any step?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fyhz-1995%2Fcudaica_win%2Fissues%2F3%23issuecomment-641327285&data=01%7C01%7Cjkroger%40nmsu.edu%7C5726edb46eba4b97b8ce08d80c7ff235%7Ca3ec87a89fb84158ba8ff11bace1ebaa%7C1&sdata=c7WZGkPyVfpPORcR%2BNBjn2T%2BzJUm%2BnbAb1HYAVU5T%2Bs%3D&reserved=0, or unsubscribehttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALRMWW7UW3P3LHKYUPBPQTDRVZAALANCNFSM4G3NDCQA&data=01%7C01%7Cjkroger%40nmsu.edu%7C5726edb46eba4b97b8ce08d80c7ff235%7Ca3ec87a89fb84158ba8ff11bace1ebaa%7C1&sdata=sgog4Z%2BiRMYKqHcoHHwdmiMN%2Fm9lE9GTu0GWZmIEKb0%3D&reserved=0.

CloudyDory commented 4 years ago

@miguelfernando55 In "icadefs.m" you should specify the full path to "cudaica_win.exe", otherwise Windows cannot find the executable. An example is shown in the following line (also in the example "icadefs.m" in the replace folder): CUDAICABINARY = fullfile(eeglab_p, 'plugins', 'CudaICA1.0', 'cudaica_win.exe');

When cudaica for windows runs, it will store a temporary file on the MATLAB's current working directory. Please make sure that there is no space in the full path of that directory.

@jimkroger What is the exact problem you face with cudaica for windows?

jimkroger commented 4 years ago

Hi Yunhii, I actually don't remember where I left off. Mainly I just was very busy and did not have time to finish working on getting it working for me. I still plan to do so, but it'll probably be next year before I have an opportunity. I will be in touch then, thank you. Are people using it now?

Sent from Outlook Mobilehttps://aka.ms/blhgte


From: yunhui notifications@github.com Sent: Tuesday, June 9, 2020 11:45:54 PM To: yhz-1995/cudaica_win cudaica_win@noreply.github.com Cc: James Kroger jkroger@nmsu.edu; Mention mention@noreply.github.com Subject: Re: [yhz-1995/cudaica_win] Error (#3)

WARNING: This email originated external to the NMSU email system. Do not click on links or open attachments unless you are sure the content is safe.

@miguelfernando55https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmiguelfernando55&data=01%7C01%7Cjkroger%40nmsu.edu%7C57bf0bbb6daa4aadf65308d80d018d65%7Ca3ec87a89fb84158ba8ff11bace1ebaa%7C1&sdata=5%2FFxY3g%2BSqHSCBR1ffD9pWtkyHXKcRsOzj%2BS6oxj%2F6k%3D&reserved=0 In "icadefs.m" you should specify the full path to "cudaica_win.exe", otherwise Windows cannot find the executable. An example in shown in the following line: CUDAICABINARY = fullfile(eeglab_p, 'plugins', 'CudaICA1.0', 'cudaica_win.exe');

When cudaica for windows runs, it will store a temporary file on the MATLAB's current working directory. Please make sure that there is no space in the full path of that directory.

@jimkrogerhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjimkroger&data=01%7C01%7Cjkroger%40nmsu.edu%7C57bf0bbb6daa4aadf65308d80d018d65%7Ca3ec87a89fb84158ba8ff11bace1ebaa%7C1&sdata=WpfAQUjWHZTolXjp6YdTLMJUJGeY11YLyulWrT5HAMc%3D&reserved=0 What is the exact problem you face with cudaica for windows?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fyhz-1995%2Fcudaica_win%2Fissues%2F3%23issuecomment-641736739&data=01%7C01%7Cjkroger%40nmsu.edu%7C57bf0bbb6daa4aadf65308d80d018d65%7Ca3ec87a89fb84158ba8ff11bace1ebaa%7C1&sdata=c599nK%2BpOzgWWZWL0bWXd6MNFGnkyuPt2rRGTggiHHg%3D&reserved=0, or unsubscribehttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALRMWW53ITDTUXMMQM7SOJTRV4MZFANCNFSM4G3NDCQA&data=01%7C01%7Cjkroger%40nmsu.edu%7C57bf0bbb6daa4aadf65308d80d018d65%7Ca3ec87a89fb84158ba8ff11bace1ebaa%7C1&sdata=JmJRXhZujQXJz42SjN79RtkyZAOkB%2Bashs3YByP0MPw%3D&reserved=0.