Search code examples
anacondawindows-10visual-studio-2019intel-oneapiintel-python

Getting the IntelOneAPI to work in Windows 10


I have successfully installed the offline Intel OneAPI base package in my Windows 10 machine. I cose the custom installation and picked only the following to install;

Intel® oneAPI Data Analytics Library.
Intel® oneAPI Deep Neural Network Library.
Intel® oneAPI Math Kernel Library.
Intel® oneAPI Threading Building Blocks.
Intel® Distribution for Python.

But I don't know how to get these things to accelerate the workflow? I don't use VisualStudio but as this installation asked for Visual Studio 2019 to be installed, I then downloaded and installed the VisualStudio 2019 and have successfully "Integrated the IDE" as stated by OneAPI installer.

But when I open VisualStudio it shows only my standalone Python 3.10 installation. When I provide the path to the Intel Python directory that Python 3.7 version shows up in the environments, but I don't know what modules are available preinstalled for Intel Python and don't know how to see them?
(an equivalent of pip list )??

My question is how do I get these to work? The Intel Python isn't showing up anywhere in Start menu and when I prowl through the directories and open the Intel python.exe the shell says this Python is inside a Conda environment and asks me to install Anaconda (which I don't have installed in my machine).

Suppose I install Anaconda now, won't that installation bring it's own Python and modules? Can I get it to detect and use the Python and modules came with Intel OneAPI??

Is it possible to link this Intel Python to other IDEs that I generally use (VSCode, standalone Spyder) by supplying the path?

Can someone walk me through this please or should I just stick to the standard Python and pip?.
The benchmarks shown by OneAPI were alluring so I decided to try but now I'm struck in the middle of nowhere.

These are my system specs in case anyone needs, Intel i5 11th gen i5-1135G7 @ 2.40GHz CPU.
NVIDIA MX330 & Iris Xe GPUs (Optimus enabled)
16 GiB RAM


Solution

  • Installation and integration of Visual Studio 2019 IDE with Intel oneAPI Base Toolkit is not a mandatory step. It can be ignored and skipped if required as stated in the installer.

    I don't know how to get these things to accelerate the workflow? My question is how do I get these to work?

    Once the installation is complete, you need to open a Command Prompt (Start -> Windows System -> Command Prompt) and run the following command along with double inverted commas.

    "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
    

    Once this is done, you will see the Intel oneAPI Base Toolkit packages being loaded and added to the environment variables. This should be done every time you are planning to use Intel oneAPI Base Toolkit packages such as Intel Distribution for Python.

    You can confirm that the Intel Distribution for Python is being loaded by running the following command in the same command prompt:

    python --version
    

    The result when you run the above command should be similar to the below format:

    Python 3.7.11 :: Intel Corporation

    Just type the below command to list the installed packages:

    pip list
    

    To install a new package, type the below command:

    pip install <package_name>
    

    Suppose I install Anaconda now, won't that installation bring it's own Python and modules? Can I get it to detect and use the Python and modules came with Intel OneAPI??

    Anaconda need not be installed to use Intel Distribution for Python. Running the above-mentioned setvars.bat command will automatically set and ensure that you are using Intel oneAPI packages including Intel Distribution for Python and its modules.

    Is it possible to link this Intel Python to other IDEs that I generally use (VSCode, standalone Spyder) by supplying the path?

    Yes, it is possible to link Intel Distribution for Python with other IDE such as VSCode. Unfortunately, Spyder IDE is not supported. To link Intel Distribution for Python with VSCode, do the following steps as mentioned in this documentation (here):

    1. Open VSCode and search for oneAPI in the VSCode Extension: Marketplace and install the "Environment Configurator for Intel(R) oneAPI Toolkits" extension provided by Intel
    2. Press Ctrl+Shift+P (or View -> Command Palette) to open the Command Palette
    3. Type Intel oneAPI to view options of the installed extension
    4. Click on Intel oneAPI: Initialize environment variables

    Once this is done, you can run/debug your code in Intel Distribution for Python from the terminal window inside VSCode.