0

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

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847

1 Answers1

3

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.

Jyothis - Intel
  • 319
  • 1
  • 5
  • 1
    First of all thanks for your help! I've successfully loaded the Intel python, but when using matplotlib in VS Code I get the following error: `C:/Program Files (x86)/Intel/oneAPI/intelpython/python3.7/tcl/tcl8.6/init.tcl: version conflict for package "Tcl": have 8.6.10, need exactly 8.6.9 version conflict for package "Tcl": have 8.6.10, need exactly 8.6.9 while executing "package require -exact Tcl 8.6.9" (file "C:/Program Files (x86)/Intel/oneAPI/intelpython/python3.7/tcl/tcl8.6/init.tcl" line 19) invoked from within` – Anoban Karunananthan Nov 30 '21 at 14:53
  • 1
    `"source {C:/Program Files (x86)/Intel/oneAPI/intelpython/python3.7/tcl/tcl8.6/init.tcl}" ("uplevel" body line 1) invoked from within "uplevel #0 [list source $tclfile]"` `This probably means that Tcl wasn't installed properly.` – Anoban Karunananthan Nov 30 '21 at 14:55
  • 1
    So I decided to upgrade the installed packages! I first installed `pip-review` successfully and then ran `pip-review -a` Here the following dependency errors were thrown! `ERROR: Cannot install dpctl==0.11.2, matplotlib==3.5.0, numba==0.54.1 and numpy==1.21.4 because these package versions have conflicting dependencies` Then I decided manually upgrade the packages with conflicting dependencies without specifying versions; and ran `pip install numpy --upgrade` But this threw a new error; – Anoban Karunananthan Nov 30 '21 at 14:56
  • 1
    `ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\\program files (x86)\\intel\\oneapi\\intelpython\\latest\\lib\\site-packages\\~umpy\\core\\_multiarray_tests.cp37-win_amd64.pyd' Consider using the `--user` option or check the permissions.` How do I proceed from here? And besides I had to change the default Python interpretor path in VS Code to get Intel Python to work, Even after activating default environmental variables!! – Anoban Karunananthan Nov 30 '21 at 14:57
  • 1
    The terminal was opened with administrator privileges and I was able to install `pip-review` successfully but `numpy` is causing problems. Could you assist me how to solve this?? I apologize if my comments are messy! – Anoban Karunananthan Nov 30 '21 at 14:59
  • 1
    All these were done while cmd was in `C:\Windows\System32>` Should I have switched to Intel Python's directory? Is it why it's saying permission is denied?? – Anoban Karunananthan Nov 30 '21 at 15:05
  • Since you are loading the Intel Python from inside the Program Files (x86) directory, make sure to run all pip command as follows: `pip install --user`. This will make sure that the packages are installed in the user directory and access denied error does not occur. – Jyothis - Intel Dec 01 '21 at 14:43
  • As mentioned in the error, you need to try upgrading NumPy using the user flag as `pip install numpy --user --upgrade`. It is not required to run these commands in the administrator command prompt if you are using the --user flag. – Jyothis - Intel Dec 01 '21 at 14:44
  • If you are using the Run button inside VSCode, you need to set the Python Interpreter to use Intel Python. The Run button will only be available if you install the Python extension from the VSCode marketplace. I am guessing you had installed that extension earlier. By default, the Python extension provided by Microsoft will try to run the code using the Python Interpreter that is present inside Windows 10 instead of the Intel Python. Hope this helps! – Jyothis - Intel Dec 01 '21 at 14:59