|
| 1 | +.. _quick_start_guide: |
| 2 | +.. include:: ./ext_links.txt |
| 3 | + |
| 4 | +.. |copy| unicode:: U+000A9 |
| 5 | + |
| 6 | +.. |trade| unicode:: U+2122 |
| 7 | + |
| 8 | +================= |
| 9 | +Quick Start Guide |
| 10 | +================= |
| 11 | + |
| 12 | +Device Drivers |
| 13 | +================= |
| 14 | + |
| 15 | +To start programming data parallel devices beyond CPU, you will need |
| 16 | +an appropriate hardware. The Data Parallel Extension for NumPy* works fine |
| 17 | +on Intel |copy| laptops with integrated graphics. In majority of cases, |
| 18 | +your Windows*-based laptop already has all necessary device drivers installed. |
| 19 | +But if you want the most up-to-date driver, you can always |
| 20 | +`update it to the latest one <https://www.intel.com/content/www/us/en/download-center/home.html>`_. |
| 21 | +Follow device driver installation instructions to complete the step. |
| 22 | + |
| 23 | + |
| 24 | +Python Interpreter |
| 25 | +================= |
| 26 | + |
| 27 | +You will need Python 3.8, 3.9, or 3.10 installed on your system. If you |
| 28 | +do not have one yet the easiest way to do that is to install |
| 29 | +`Intel Distribution for Python*`_. It installs all essential Python numerical |
| 30 | +and machine learning packages optimized for the Intel hardware, including |
| 31 | +Data Parallel Extension for NumPy*. |
| 32 | +If you have Python installation from another vendor, it is fine too. All you |
| 33 | +need is to install Data Parallel Extension for NumPy* manually as shown |
| 34 | +in the next installation section. |
| 35 | + |
| 36 | + |
| 37 | +Installation |
| 38 | +============ |
| 39 | + |
| 40 | +Install Package from Anaconda |
| 41 | +--------------------- |
| 42 | + |
| 43 | +It is recommended to use conda packages from the ``anaconda.org/intel`` |
| 44 | +channel. You will need one of the commands below: |
| 45 | + |
| 46 | +* Conda: ``conda install numba-dpex`` |
| 47 | + |
| 48 | +* Pip: ``pip install numba-dpex`` |
| 49 | + |
| 50 | +These commands install dpnp package along with its dependencies, including |
| 51 | +``dpctl`` package with `Data Parallel Control Library`_ and all required |
| 52 | +compiler runtimes and OneMKL. |
| 53 | + |
| 54 | +.. note:: |
| 55 | + Before installing with conda or pip it is strongly advised to update ``conda`` and ``pip`` to latest versions |
| 56 | + |
| 57 | + |
| 58 | +Build and Install Conda Package |
| 59 | +------------------------------- |
| 60 | + |
| 61 | +Alternatively you can create and activate a local conda build environment: |
| 62 | + |
| 63 | +.. code-block:: bash |
| 64 | +
|
| 65 | + conda create -n build-env conda-build |
| 66 | + conda activate build-env |
| 67 | +
|
| 68 | +And to build dpnp package from the sources: |
| 69 | + |
| 70 | +.. code-block:: bash |
| 71 | +
|
| 72 | + conda build conda-recipe -c intel -c conda-forge |
| 73 | +
|
| 74 | +Finanly, to install the result package: |
| 75 | + |
| 76 | +.. code-block:: bash |
| 77 | +
|
| 78 | + conda install dpnp |
| 79 | +
|
| 80 | +
|
| 81 | +Build and Install with scikit-build |
| 82 | +----------------------------------- |
| 83 | + |
| 84 | +Another way to build and install dpnp package from the source is to use Python |
| 85 | +``setuptools`` and ``scikit-build``. You will need to create a local conda |
| 86 | +build environment by command below depending on hosting OS. |
| 87 | + |
| 88 | +On Linux: |
| 89 | + |
| 90 | +.. code-block:: bash |
| 91 | +
|
| 92 | + conda create -n build-env dpctl cython dpcpp_linux-64 mkl-devel-dpcpp tbb-devel onedpl-devel cmake scikit-build ninja pytest -c intel -c conda-forge |
| 93 | + conda activate build-env |
| 94 | +
|
| 95 | +On Windows: |
| 96 | + |
| 97 | +.. code-block:: bash |
| 98 | +
|
| 99 | + conda create -n build-env dpctl cython dpcpp_win-64 mkl-devel-dpcpp tbb-devel onedpl-devel cmake scikit-build ninja pytest -c intel -c conda-forge |
| 100 | + conda activate build-env |
| 101 | +
|
| 102 | +To build and install the package on Linux OS, run: |
| 103 | + |
| 104 | +.. code-block:: bash |
| 105 | +
|
| 106 | + python setup.py install -- -G Ninja -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx |
| 107 | +
|
| 108 | +To build and install the package on Windows OS, run: |
| 109 | + |
| 110 | +.. code-block:: bash |
| 111 | +
|
| 112 | + python setup.py install -- -G Ninja -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx |
| 113 | +
|
| 114 | +
|
| 115 | +Testing |
| 116 | +======= |
| 117 | + |
| 118 | +If you want to execute the scope of Python test suites which are available |
| 119 | +by the source, you will need to run a command as below: |
| 120 | + |
| 121 | +.. code-block:: bash |
| 122 | +
|
| 123 | + pytest -s tests |
0 commit comments