Skip to content

Latest commit

 

History

History
111 lines (81 loc) · 3.9 KB

File metadata and controls

111 lines (81 loc) · 3.9 KB

Docker Files

Setting up Docker and Running a chipStar Sample

  1. Install Docker:

  2. Pull the chipStar 'latest' image:

    docker pull pveleskopglc/chipstar:latest
    
  3. Run the container:

    docker run -it pveleskopglc/chipstar:latest /bin/bash
    

    This command starts an interactive session without binding any GPUs to the container - a couple of OpenCL CPU runtimes are setup already.

  4. Execute a matrix multiply sample:

    CHIP_DEVICE_TYPE=cpu CHIP_BE=opencl ~/chipStar/build/samples/0_MatrixMultiply/MatrixMultiply 
    Device name 13th Gen Intel(R) Core(TM) i9-13900K
    Running 1 iterations 
    hipLaunchKernel 0 time taken: 185.903
    hipLaunchKernel BEST TIME: 185.903
    GPU real time taken(ms): 193.007
    matrixMultiplyCPUReference time taken(ms): 2861.23
    Verification PASSED!
    

This process will set up Docker, pull the latest chipStar image, start a container with the necessary environment, and run a sample application to verify the setup.

Running Docker Image with GPU

To run the Docker image with GPU support, follow these steps:

  1. Run the Docker container with GPU support:

    docker run -it --device /dev/dri/card0 --device /dev/dri/card1 \
               --device /dev/dri/renderD128 --device /dev/dri/renderD129 \
               --group-add 110 --group-add 44 --privileged \
               -e NEOReadDebugKeys=1 -e OverrideGpuAddressSpace=48 \
               pveleskopglc/chipstar:latest /bin/bash
    

    Note: For kernel 6.8+, the NEOReadDebugKeys=1 and OverrideGpuAddressSpace=48 environment variables are required for Intel GPU detection.

  2. Unload PoCL module to expose Intel GPUs (if available):

    module unload pocl/main-llvm-22.0-native
    
  3. Run a GPU-accelerated sample:

    CHIP_DEVICE_TYPE=gpu CHIP_BE=opencl ~/chipStar/build/samples/0_MatrixMultiply/MatrixMultiply
    

This process allows you to run the chipStar Docker image with GPU support, enabling GPU-accelerated computations within the container.

DockerfileBase Overview

  • Base: Ubuntu latest
  • User: 'chipStarUser' with sudo, video, render group access
  • Core tools: gcc, g++, cmake, python3, git, OpenCL dev environment
  • LLVM/Clang: 22.0 with the native (integrated) SPIR-V backend (llvm/22.0-native)
  • Lmod: For environment module management
  • POCL: Portable OpenCL implementation (built from main for LLVM 22 support)
  • Intel OneAPI: Via Miniconda, includes MKL, TBB, DPC++
  • Level Zero API: For low-level device control

Purpose: Comprehensive chipStar development environment, supporting both open-source and Intel proprietary frameworks.

DockerfileCPPLinter Overview

This layer builds upon the base image and adds:

  • Python virtual environment setup
  • C++ linting tools installation

Key components:

  • Python3 venv: For isolated Python environment
  • clang-tools (version 0.13.0): Provides static analysis and linting capabilities for C++
  • cpp-linter (version 1.10.0): A tool for linting C++ code

Purpose: Enhances the development environment with code quality tools specifically for C++ projects, enabling better code analysis and consistency checks.

DockerfileLatest Overview

This layer builds upon the base image and adds:

  • Additional Python packages
  • LLVM/Clang 22 (native SPIR-V backend) environment setup
  • Vim common tools
  • chipStar build and installation

Key components:

  • PyYAML: Python package for YAML parsing
  • LLVM/Clang 22 (native SPIR-V backend): Loaded via llvm/22.0-native module
  • Vim common: Includes 'xxd' utility
  • chipStar:
    • Cloned from GitHub
    • Built with CMake (Release mode, HIPBLAS enabled)
    • Installed system-wide
    • Test suite built (for OpenCL backend, CPU device type)

Purpose: Provides a complete environment for chipStar development and testing.