Skip to content

Commit c9cb28b

Browse files
committed
Merge pull request #2747 from CharlesCongdon/cc_tutupdate20260
Updates for oneAPI 2026.0 tools and drivers
1 parent ee8133c commit c9cb28b

14 files changed

Lines changed: 479 additions & 230 deletions

File tree

Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `Guided Matrix Multiplication Bad Buffers` Sample
22

3-
The `Guided Matrix Multiplication Bad Buffers` sample demonstrates how to use several tools in the Intel® oneAPI Base Toolkit (Base Kit) to triage incorrect use of the SYCL language.
3+
The `Guided Matrix Multiplication Bad Buffers` sample demonstrates how to use several tools in Intel® oneAPI to triage incorrect use of the SYCL language.
44

55
The sample is a simple program that multiplies together two large matrices and verifies the results.
66

@@ -31,9 +31,9 @@ The sample includes different versions of a simple matrix multiplication program
3131
| Optimized for | Description
3232
|:--- |:---
3333
| OS | Ubuntu* 24.04 LTS
34-
| Hardware | GEN9 or newer
35-
| Software | Intel® oneAPI DPC++/C++ Compiler 2025.3 <br> Intel® Distribution for GDB* 2025.3 <br> Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace).
36-
| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.31 or later from https://dgpu-docs.intel.com/releases/releases.html
34+
| Intel Graphics Hardware | GEN9 or newer
35+
| Software | Intel® oneAPI DPC++/C++ Compiler 2026.0 <br> Intel® Distribution for GDB* 2026.0 <br> Unified Tracing and Profiling Tool 2.3.0, which is available from the [following Github repository](https://github.com/intel/pti-gpu/tree/master/tools/unitrace).
36+
| Intel GPU Driver | Intel® General-Purpose GPU Long-Term Support driver 2523.59 or later from https://dgpu-docs.intel.com/releases/releases.html
3737

3838
## Key Implementation Details
3939

@@ -46,7 +46,7 @@ The basic SYCL* standards implemented in the code include the use of the followi
4646

4747
## Set Environment Variables
4848

49-
When working with the command-line interface (CLI), configure the oneAPI toolkit environment variables. Set up your CLI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development.
49+
When working with the command-line interface (CLI), set up your oneAPI environment by sourcing the `setvars` script every time you open a new terminal window. This practice ensures that your compiler, libraries and tools are ready for development.
5050

5151
## Build the `Guided Matrix Multiplication Bad Buffers` Programs
5252

@@ -121,28 +121,27 @@ the `VERBOSE=1` argument:
121121
```
122122
make VERBOSE=1
123123
```
124-
If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the *[Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/docs/oneapi/user-guide-diagnostic-utility/current/overview.html)* for more information on using the utility.
125124

126125

127126
## Guided Debugging
128127

129128
These instructions assume you have installed the Intel® Distribution for GDB* and have a basic working knowledge of GDB.
130129

131130
### Setting up to Debug on the GPU
132-
To learn how setup and use Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GDB-PVC debugger](https://dgpu-docs.intel.com/system-user-guides/DNP-Max-1100-userguide/DNP-Max-1100-userguide.html#gdb-pvc-debugger)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*.
131+
To learn how setup and use the Intel® Distribution for GDB*, see the *[Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/get-started-guide-linux/current/overview.html)*. Additional setup instructions you should follow are at *[GPU Debugging](https://dgpu-docs.intel.com/driver/gpu-debugging.html)* and *[Configuring Kernel Boot Parameters](https://dgpu-docs.intel.com/driver/configuring-kernel-boot-parameters.html)*.
133132

134133
Documentation on using the debugger in a variety of situations can be found at *[Debug Examples in Linux](https://www.intel.com/content/www/us/en/docs/distribution-for-gdb/tutorial-debugging-dpcpp-linux/current/overview.html)*
135134

136135
>**Note**: SYCL applications will use the oneAPI Level Zero runtime by default. oneAPI Level Zero provides a low-level, direct-to-metal interface for the devices in a oneAPI platform. For more information see the *[Level Zero Specification Documentation - Introduction](https://oneapi-src.github.io/level-zero-spec/level-zero/latest/core/INTRO.html)* and *[Intel® oneAPI Level Zero](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/current/intel-oneapi-level-zero.html)*.
137136
138137
### Getting the Tracing and Profiling Tool
139138

140-
In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI Base Toolkit (Base Kit).
139+
In this tutorial, the instructions require a utility that was not installed with the Intel® oneAPI.
141140

142141
To complete the steps in the following section, you must download the [Unified Tracing and Profiling Tool](https://github.com/intel/pti-gpu/tree/master/tools/unitrace) code from GitHub and build the utility. The build instructions are included in the README in the GitHub repository. This build will go much more smoothly if you first install the latest drivers from [the Intel GPU driver download site](https://dgpu-docs.intel.com/driver/overview.html), especially the development packages (only available in the Data Center GPU driver install). Once you have built the utility, you invoke it on the command line in front of your program (similar to using GDB).
143142

144143
### Guided Instructions for Zero Buffer using Address Sanitizer
145-
A recent addition to the oneAPI compiler is that ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application.
144+
The oneAPI compiler has the ability to use the "Address Sanitizer" you may have seen when using [GCC](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) or [CLANG](https://clang.llvm.org/docs/AddressSanitizer.html) to catch invalid pointer addresses at runtime on the GPU rather than the host. This will require a special build of the application.
146145

147146
1. Compile a version of the program with device-side Address Sanitizer (assuming that you are in the `build` directory)
148147
```
@@ -198,7 +197,7 @@ A recent addition to the oneAPI compiler is that ability to use the "Address San
198197

199198
### Guided Instructions for Zero Buffer using gdb-oneapi and the OpenCL CPU device
200199

201-
In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `lambda` function. **This will cause the application to crash.** We saw in the previous section how we can catch this with the device-side Address Sanitizer. But what if the bad array allocation occured somewhere else deep in the program? How would we track the problem back to its source? Let's try one technique to locate the source of the error.
200+
In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `lambda` function. **This will cause the application to crash.** We saw in the previous section how we can catch this with the device-side Address Sanitizer. But what if the bad array allocation occurred somewhere else deep in the program? How would we track the problem back to its source? Let's try one technique to locate the source of the error.
202201

203202
1. Run the program without the debugger.
204203

@@ -353,7 +352,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `
353352
0}}, static dimensions = <optimized out>}, MOffset = {<sycl::_V1::detail::array<2>> = {common_array = {0,
354353
0}}, static dimensions = <optimized out>}}}
355354
```
356-
Clearly there is a mismatch here! 'a' has no space reserved for it, yet we will be iterating over 150 by 300 elements (and updating element 131 by 0 in this thread), which is clearly an error.
355+
Clearly there is a mismatch here: 'a' has no space reserved for it, yet we will be iterating over 150 by 300 elements (and updating element 131 by 0 in this thread), which is clearly an error.
357356
358357
9. To further root-cause the error, we will need to restart the program and look at the values of the buffers behind the accessors (`a_buf` and `b_buf`), which are not in scope in any of our stack frames. We'll set some breakpoints at the `parallel_for` statements where they are initialized.
359358
@@ -416,7 +415,7 @@ In `a1_matrix_mul_zero_buff`, a zero-element buffer is passed to a SYCL submit `
416415
```
417416
418417
### Guided Instructions for Null Device Pointer using Address Sanitizer
419-
Let us use the Address Sanitizer again to catch invalid pointer addresses at runtime, this time in code that makes use of explicit device memory allocations rather than using SYCL buffers. This will require a special build of the application.
418+
Let us use the Address Sanitizer again to catch invalid pointer addresses at runtime, this time in code that makes use of explicit device-memory allocations rather than using SYCL buffers. This will require a special build of the application.
420419
421420
1. Compile a version of the program with device-side Address Sanitizer (assuming that you are in the `build` directory)
422421
```
@@ -544,7 +543,7 @@ In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is suppo
544543
545544
#### Debugging the Problem
546545
547-
Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests as something that goes terribly wrong. Or one of the backbends might have a bug while the others do not. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address `0x0`, while this may be legally allocated memory on the GPU.
546+
Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests when something goes terribly wrong. Or one of the backbends might have a bug while the others do not. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address `0x0`, while this may be legally allocated memory on the GPU.
548547
549548
Another reason to try different backends is that debugging support may differ between different GPU drivers and/or different GPU models. Debugging the program using the OpenCL™ CPU driver gets around these issues.
550549

Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b1_matrix_mul_null_usm.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ int main() {
132132
q.memcpy(&c_back[0], dev_c, M*P * sizeof(float));
133133

134134
q.wait();
135+
136+
sycl::free(dev_a, q);
137+
sycl::free(dev_b, q);
138+
sycl::free(dev_c, q);
135139
}
136140

137141
int result;

Tools/ApplicationDebugger/guided_matrix_mult_BadBuffers/src/b2_matrix_mul_usm.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ int main() {
130130
q.memcpy(&c_back[0], dev_c, M*P * sizeof(float));
131131

132132
q.wait();
133+
134+
sycl::free(dev_a, q);
135+
sycl::free(dev_b, q);
136+
sycl::free(dev_c, q);
133137
}
134138

135139
int result;

0 commit comments

Comments
 (0)