If you have a modern Nvidia graphics card, try CUDAICA for speeding it up!
Install CUDA Toolkit
As a prerequisite make sure after you install your Nvidia graphics driver to also install the CUDA toolkit located here.
Install CUDAICA EEGLAB Plugin
In a new folder, download files from the CUDAICA github repository. Use git clone from the command line for a 1-line version.
git clone https://github.com/CloudyDory/cudaica_win.git
Copy the EEGLAB_Plugin folder to the `eeglab\plugins` folder.
Copy `pop_runica.m` from the plugin folder to the eeglab\functions\popfunc
folder to replace the file.
If you try to run CUDAICA at this point you will likely get this error:
Simplifying Intel Math Library Installation
Out of the several hundred megabytes of the Intel distribution only THREE files appear to be necessary to run CUDAICA.
Installing the Intel Math Kernel Libraries (or OneAPI) has always been a pain for me, so I have an alternative solution. There is also an incredibly messy step of having to update the Windows path. Instead, we will MKL files directly and add them to the plugin folder. To Intel’s credit, they have multiple ways of downloading the libraries including package managers.
I would recommend the NuGet package manager since it is a single executable that doesn’t require administrative login. Download the CLI (command line interface) here.
Next at the command line run the following command (within your downloads folder):
./nuget install intelmkl.devel.win-x64
Open the folder C:\Users\ernie\Downloads\intelmkl.redist.win-x64.2022.0.3.171\runtimes\win-x64\native
Copy the three files:
mkl_core.2.dll
mkl_def.2.dll
mkl_intel_thread.2.dll
to the eeglab\plugins\CudaICA1.1
Finally, edit the autodetection of MKL in the cudaica.m to simplify it as follows:
Since the MKL files are now in the same directory as the plugin, it will not try to find the files on your system path. You also will save several hundred megabytes of space and frustration regarding your environmental paths.
At this point, you should be able to run CUDAICA from the command line. You can use the vHTP wrapper for running EEGLAB ICA found in our toolkit. All toolkit functions take and EEG SET file and return an EEG SET file.
vHTP script interface for CUDAICA and component removal
EEG.postica = eeg_htpEegIcaEeglab(EEG.common, 'method', 'cudaica');
EEG.cleaned = eeg_htpEegRemoveCompsEeglab( EEG.postica);
Try the function eeg_htpEegIcaEeglab.m to run CUDAICA through EEGLAB.
use the following options:
EEG = eeg_htpEegIcaEeglab(EEG, 'method', 'cudaica');
Next, if you want to view and remove components try the function:
Hopefully this helps simplify the often frustrating process of installing CUDAICA!