Coder Social home page Coder Social logo

mspronesti / sycl-containers Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 15 KB

Docker containers for SYCL developement on NVidia GPUs using llvm, hipSYCL and Intel OneAPI.

License: MIT License

Dockerfile 66.28% Shell 33.72%
cuda docker dpcpp hipsycl intel llvm nvidia oneapi

sycl-containers's Introduction

SYCL Containers

Self-contained containers for SYCL developement, originally written for personal usage.

llvm-cuda

Contains:

  • llvm 15.0.0
  • DPC++
  • CUDA 14.4
  • oneMKL
  • Lapack
  • oneTBB
  • dpct (c2s)
  • boost 1.65

hipSYCL

Contains:

  • hipSYCL (latest)
  • CUDA 14.4
  • llvm 13
  • oneMKL
  • boost 1.65

oneAPI-cuda

Contains:

  • intel oneapi basekit (oneMKL, oneDPL, ...)
  • CUDA 14.4
  • llvm 15.0.0
  • boost 1.65

Getting started

Before building the container, please make sure you have the NVIDIA container toolkit properly set up. If you don't, first setup the package repository and the GPG key:

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

then just run

sudo apt-get update
sudo apt-get install -y nvidia-docker2

and eventually restart the Docker daemon

sudo systemctl restart docker

Build

Let's assume you want to build llvm-cuda. Then run

docker build -f llvm-cuda/Dockerfile -t mspronesti/sycl-container:llvm-cuda .

The image requires roughly 23 GB, make sure to have enough space. Also beware it takes roughly 2 hours to build.

Run

Once the image is build, just run it as follows

docker run -it --gpus all mspronesti/sycl-container:llvm-cuda bash

Build a SYCL application on NVidia GPU

Once you got a shell, write your code or clone it from wherever it is and compile it making sure to use clang++ as compiler and to specify the following compilation options, among the others, in you Makefile or CMakeLists

-fsycl -fsycl-targets=nvptx64-nvidia-cuda

Build a SYCL application using HipSYCL on NVidia GPU or OMP.

Compile it using syclcc, specifying the extra option --hipsycl-gpu-arch. For instance

syclcc --hipsycl-gpu-arch=sm_75 dummy.cpp -o dummy

If you want instead to run it on CPU, specify --hipsycl-targets.

syclcc --hipsycl-targets=omp dummy.cpp -o dummy

Alternatively, export HIPSYCL_TARGETS before compiling. For instance

export HIPSYCL_TARGETS=cuda:sm_75

sycl-containers's People

Contributors

mspronesti avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

raja-appuswamy

sycl-containers's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.