You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sycl/doc/GetStartedGuide.md
+32-1Lines changed: 32 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ and a wide range of compute accelerators such as GPU and FPGA.
15
15
*[Build DPC++ toolchain with support for ARM processors](#build-dpc-toolchain-with-support-for-arm-processors)
16
16
*[Build DPC++ toolchain with support for runtime kernel fusion and JIT compilation](#build-dpc-toolchain-with-support-for-runtime-kernel-fusion-and-jit-compilation)
17
17
*[Build DPC++ toolchain with a custom Unified Runtime](#build-dpc-toolchain-with-a-custom-unified-runtime)
18
+
*[Build DPC++ toolchain with device image compression support](#build-dpc-toolchain-with-device-image-compression-support)
|`hwloc`| >= 2.3 (Linux only, `libhwloc-dev` or `hwloc-devel`) |
49
50
| C++ compiler |[See LLVM](https://github.com/intel/llvm/blob/sycl/llvm/docs/GettingStarted.rst#host-c-toolchain-both-compiler-and-standard-library)|
51
+
|`zstd` (optional) | >= 1.4.8 (see [ZSTD](#build-dpc-toolchain-with-device-image-compression-support)) |
50
52
51
53
Alternatively, you can create a Docker image that has everything you need for
52
54
building pre-installed using the [Ubuntu 24.04 build Dockerfile](https://github.com/intel/llvm/blob/sycl/devops/containers/ubuntu2404_build.Dockerfile).
@@ -94,7 +96,8 @@ The easiest way to get started is to use the buildbot
94
96
[compile](../../buildbot/compile.py) scripts.
95
97
96
98
In case you want to configure CMake manually the up-to-date reference for
97
-
variables is in these files.
99
+
variables is in these files. Note that the CMake variables set by default by the [configure.py](../../buildbot/configure.py) script are the ones commonly used by
100
+
DPC++ developers and might not necessarily suffice for your project-specific needs.
98
101
99
102
**Linux**:
100
103
@@ -127,6 +130,7 @@ flags can be found by launching the script with `--help`):
127
130
*`-t` -> Build type (Debug or Release)
128
131
*`-o` -> Path to build directory
129
132
*`--cmake-gen` -> Set build system type (e.g. `--cmake-gen "Unix Makefiles"`)
133
+
*`--use-zstd` -> Force link zstd while building LLVM (see [ZSTD](#build-dpc-toolchain-with-device-image-compression-support))
130
134
131
135
You can use the following flags with `compile.py` (full list of available flags
132
136
can be found by launching the script with `--help`):
@@ -320,6 +324,33 @@ DPC++ toolchain, but add the `--disable-jit` flag.
320
324
Both kernel fusion and JIT compilation of AMD and Nvidia kernels are currently
321
325
not yet supported on the Windows platform.
322
326
327
+
### Build DPC++ toolchain with device image compression support
328
+
329
+
Device image compression enables the compression of device code (SYCL Kernels) during compilation and decompressing them on-demand during the execution of the corresponding SYCL application.
330
+
This reduces the size of fat binaries for both Just-in-Time (JIT) and Ahead-of-Time (AOT) compilation. Refer to the [blog post](https://www.intel.com/content/www/us/en/developer/articles/technical/sycl-compilation-device-image-compression.html) for more details on this feature.
331
+
332
+
To enable device image compression, you need to build the DPC++ toolchain with the
333
+
zstd compression library. By default, zstd is optional for DPC++ builds i.e. CMake will search for zstd installation but if not found, it will not fail the build
334
+
and this feature will simply be disabled.
335
+
336
+
To override this behavior and force the build to use zstd, you can use the `--use-zstd` flag in the `configure.py` script or by adding `-DLLVM_ENABLE_ZSTD=FORCE_ON` to the CMake configuration command.
337
+
338
+
#### How to obtain zstd?
339
+
340
+
Minimum zstd version that we have tested with is *1.4.8*.
341
+
342
+
**Linux**:
343
+
344
+
You can install zstd using the package manager of your distribution. For example, on Ubuntu, you can run:
345
+
```sh
346
+
sudo apt-get install libzstd-dev
347
+
```
348
+
Note that the libzstd-dev package provided on Ubuntu 24.04 has a bug ([link](https://bugs.launchpad.net/ubuntu/+source/libzstd/+bug/2086543)) and the zstd static library is not built with the `-fPIC` flag. Linking to this library will result in a build failure. For example: [Issue#15935](https://github.com/intel/llvm/issues/15935). As an alternative, zstd can be built from source either manually or by using the [build_zstd_1_5_6_ub24.sh](https://github.com/intel/llvm/blob/sycl/devops/scripts/build_zstd_1_5_6_ub24.sh) script.
349
+
350
+
**Windows**
351
+
352
+
For Windows, prebuilt zstd binaries can be obtained from the [facebook/zstd](https://github.com/facebook/zstd/releases/tag/v1.5.6) release page. After obtaining the zstd binaries, you can add the path to the zstd installation directory to the `PATH` environment variable.
353
+
323
354
### Build Doxygen documentation
324
355
325
356
Building Doxygen documentation is similar to building the product itself. First,
// CHECK: '--offload-compress' option is specified but zstd is not available. The device image will not be compressed.
4
+
// CHECK: error: '--offload-compress' is specified but the compiler is built without zstd support.
5
+
// CHECK-NEXT: If you are using a custom DPC++ build, please refer to https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md#build-dpc-toolchain-with-device-image-compression-support for more information on how to build with zstd support.
0 commit comments