Black-Scholes Workload

Follow this procedure to run simple oneMKL Black-Scholes example.

  • Operating system: Ubuntu* 22.04

  • Hardware: Intel® Data Center Max GPUs

  • Software: Intel® oneAPI Base toolkit, Intel® oneAPI HPC toolkit

  • Time to complete: 15 minutes

For more information on the Black-Scholes sample, see Black-Scholes Sample.

  1. Check whether the driver stack is installed.

    $ xpu-smi discovery
    

    The command should return at least one Intel® Data Center GPU Max device.

  2. Check whether the oneAPI toolkit is installed.

    $ apt list intel-basekit intel-hpckit
    

    Expected output:

    Listing... Done
    intel-basekit/all,now 2023.2.0-49384 amd64 [installed]
    intel-hpckit/all,now 2023.2.0-49438 amd64 [installed]
    
  3. If you previously have not configured your environment, install the Ubuntu 22.04 graphics driver. See dgpu-docs for details.

    Note

    Access to Ubuntu repositories, such as https://repositories.intel.com and https://apt.repos.intel.com, is required for installation. If proxy settings involve changes to environment variables such as http_proxy or https_proxy, small modifications are required in the following steps, such as adding -E (preserve environment) to sudo commands.

  4. If you previously have not configured your environment, enable access to the Intel repo serving the oneAPI packages and install the oneAPI Base toolkit and HPC toolkit for Ubuntu 22.04.

    wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
    echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo  tee /etc/apt/sources.list.d/oneAPI.list
    sudo apt update
    
    sudo apt install -y intel-basekit intel-hpckit
    
  5. Build Black-Scholes, which is a oneAPI sample.

    git clone https://github.com/oneapi-src/oneAPI-samples.git
    cd oneAPI-samples/Libraries/oneMKL/black_scholes
    source /opt/intel/oneapi/setvars.sh 
    make
    
  6. Run Black-Scholes.

    $ ./black_scholes_sycl
    

The following example presents a result snapshot from Intel® Data Center GPU Max 1550:

Double Precision Black&Scholes Option Pricing version 1.6 running on Intel(R) Data Center GPU Max 1550 using DPC++, workgroup size 256, sub-group size 32.
Compiler Version: Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230721), LLVM 17.0 based.
Driver Version  : 1.3.26516
Build Time      : Nov  8 2023 21:44:06
Input Dataset   : 8388608
Pricing 16777216 Options in 512 iterations, 8589934592 Options in total.
...
TEST PASSED