Skip to content

[GSD-13448] sycl::malloc_device() failed when allocate memory size is more than 19.3GB, through the "Max memory allocation" is 30.3GB on B70 #998

Description

@arthw

Pre-submission Checklist

  • I am using the latest GPU driver version (releases)
  • I have searched for similar issues and found none

GPU Hardware

B70

DRI Devices Information

ls -ls /dev/dri/*
0 crw-rw----+    1 root video  226,   0 Sep 14 21:52 /dev/dri/card0
0 crw-rw----+    1 root video  226,   1 Sep 14 21:52 /dev/dri/card1
0 crw-rw----+    1 root render 226, 128 Sep 14 21:52 /dev/dri/renderD128
0 crw-rw----+    1 root render 226, 129 Sep 14 21:52 /dev/dri/renderD129

/dev/dri/by-path:
total 0
0 lrwxrwxrwx+1 root root  8 Sep 14 21:52 pci-0000:00:02.0-card -> ../card0
0 lrwxrwxrwx+1 root root 13 Sep 14 21:52 pci-0000:00:02.0-render -> ../renderD128
0 lrwxrwxrwx+1 root root  8 Sep 14 21:52 pci-0000:03:00.0-card -> ../card1
0 lrwxrwxrwx+1 root root 13 Sep 14 21:52 pci-0000:03:00.0-render -> ../renderD129

GPU Detailed Information (lspci output)

lspci -vvv -k -s 0000:03:00.0
03:00.0 VGA compatible controller: Intel Corporation Battlemage G31 [Arc Pro B70] (prog-if 00 [VGA controller])
	Subsystem: Shenzhen Gunnir Technology Development Co., Ltd Device 2742
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin ? routed to IRQ 172
	IOMMU group: 15
	Region 0: Memory at 7607000000 (64-bit, prefetchable) [size=16M]
	Region 2: Memory at 6000000000 (64-bit, prefetchable) [size=32G]
	Expansion ROM at 60400000 [disabled] [size=2M]
	Capabilities: <access denied>
	Kernel driver in use: xe
	Kernel modules: xe

Driver Version

26.31.39395.13

Installed GPU Driver Packages

sudo dpkg --list | grep -iE "igc|gmm|opencl|level-zero|fc|level_zero|ocloc|libze"
ii  bpfcc-tools                                      0.35.0+ds-1ubuntu2                         all          tools for BPF Compiler Collection (BCC)
ii  clinfo                                           3.0.25.02.14-1build1                       amd64        Query OpenCL system information
ii  elementary-xfce-icon-theme                       0.22-1                                     all          elementary icon theme modified for Xfce
ii  gir1.2-libxfce4ui-2.0:amd64                      4.20.2-1                                   amd64        Typelib file for libxfce4ui
ii  gir1.2-libxfce4util-1.0:amd64                    4.20.1-1build1                             amd64        Typelib file for libxfce4util
ii  gir1.2-xfconf-0:amd64                            4.20.0-1build1                             amd64        utilities for managing settings in Xfce - introspection support
ii  intel-igc-core-2                                 2.40.13                                    amd64        Intel(R) Graphics Compiler for OpenCL(TM)
ii  intel-igc-opencl-2                               2.40.13                                    amd64        Intel(R) Graphics Compiler for OpenCL(TM)
ii  intel-ocloc                                      26.31.39395.13-1~26.04~ppa1                amd64        Tool for managing Intel Compute GPU device binary format
ii  intel-opencl-icd                                 26.31.39395.13-1~26.04~ppa1                amd64        Intel graphics compute runtime for OpenCL
ii  intltool-debian                                  0.35.0+20060710.6build1                    all          Help i18n of RFC822 compliant config files
ii  libbpfcc:amd64                                   0.35.0+ds-1ubuntu2                         amd64        shared library for BPF Compiler Collection (BCC)
ii  libcbor0.10:amd64                                0.10.2-2ubuntu3                            amd64        library for parsing and generating CBOR (RFC 7049)
ii  libcgi-fast-perl                                 1:2.17-1                                   all          CGI subclass for work with FCGI
ii  libdebconfclient0:amd64                          0.280ubuntu1                               amd64        Debian Configuration Management System (C-implementation library)
ii  libemail-address-xs-perl                         1.05-1build5                               amd64        Perl library for RFC 5322 address/group parsing and formatting
ii  libexo-2-0:amd64                                 4.20.0-1build1                             amd64        Library with extensions for Xfce (GTK-3 version)
ii  libfcgi-bin                                      2.4.5-0.1build2                            amd64        FastCGI bridge from CGI
ii  libfcgi-perl                                     0.82+ds-3build3                            amd64        helper module for FastCGI
ii  libfcgi0t64:amd64                                2.4.5-0.1build2                            amd64        shared library of FastCGI
ii  libfile-fcntllock-perl                           0.22-4ubuntu6                              amd64        Perl module for file locking with fcntl(2)
ii  libgarcon-1-0:amd64                              4.20.0-1build1                             amd64        freedesktop.org compliant menu implementation for Xfce
ii  libgarcon-gtk3-1-0:amd64                         4.20.0-1build1                             amd64        menu library for Xfce (GTK3 library)
ii  libigc2                                          2.40.13+ds1-1~26.04                        amd64        Core libraries for Intel(R) Graphics Compiler for OpenCL(TM)
ii  libigdfcl2                                       2.40.13+ds1-1~26.04                        amd64        OpenCL library for Intel(R) Graphics Compiler for OpenCL(TM)
ii  libigdgmm12:amd64                                22.10.1-1~26.04~ppa1                       amd64        Intel Graphics Memory Management Library -- shared library
ii  libmath-base85-perl                              0.5+dfsg-2                                 all          Perl extension for base 85 numbers, as referenced by RFC 1924
ii  libsigc++-2.0-0v5:amd64                          2.12.1-4build1                             amd64        type-safe Signal Framework for C++ - runtime
ii  libsigc++-3.0-0:amd64                            3.6.0-2build1                              amd64        type-safe Signal Framework for C++ - runtime
ii  libxfce4panel-2.0-4                              4.20.7-1                                   amd64        Xfce4 panel library (GTK3 variant)
ii  libxfce4ui-2-0:amd64                             4.20.2-1                                   amd64        widget library for Xfce - Gtk+3 variant
ii  libxfce4ui-common                                4.20.2-1                                   all          common files for libxfce4ui
ii  libxfce4ui-utils                                 4.20.2-1                                   amd64        Utility files for libxfce4ui
ii  libxfce4util-bin                                 4.20.1-1build1                             amd64        tools for libxfce4util
ii  libxfce4util-common                              4.20.1-1build1                             all          common files for libxfce4util
ii  libxfce4util7:amd64                              4.20.1-1build1                             amd64        Utility functions library for Xfce4
ii  libxfce4windowing-0-0:amd64                      4.20.5-1                                   amd64        Wayland utility functions library for Xfce4
ii  libxfce4windowing-common                         4.20.5-1                                   all          common files for libxfce4windowing
ii  libxfconf-0-3:amd64                              4.20.0-1build1                             amd64        Client library for Xfce4 configure interface
ii  libze-dev:amd64                                  1.32.0-1~26.04~ppa1                        amd64        oneAPI Level Zero -- development files
ii  libze-intel-gpu1                                 26.31.39395.13-1~26.04~ppa1                amd64        Intel oneAPI L0 support implementation for Intel GPUs -- shared library
ii  libze1:amd64                                     1.32.0-1~26.04~ppa1                        amd64        oneAPI Level Zero -- share libraries
ii  linux-firmware-qlogic                            20260319.git217ca6e4-0ubuntu1.1            all          Firmware for QLogic SCSI, FC, and IB host bus and Ethernet adapters
ii  mousepad                                         0.7.0-1                                    amd64        simple Xfce oriented text editor
ii  node-punycode                                    2.3.1+~2.1.4-1                             all          Nodejs robust Punycode converter fully RFC compliant
ii  node-uuid                                        8.3.2+~8.3.4-3                             all          simple and fast RFC4122 UUID generation - Node.js module
ii  node-ws                                          8.19.0+~cs14.19.1-1                        all          RFC-6455 WebSocket implementation module for Node.js
ii  nvidia-cuda-toolkit-doc                          12.4.1-8                                   all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-opencl-dev:amd64                          12.4.127~12.4.1-8                          amd64        NVIDIA OpenCL development files
ii  nvidia-profiler                                  12.4.127~12.4.1-8                          amd64        NVIDIA Profiler for CUDA and OpenCL
ii  ocl-icd-libopencl1:amd64                         2.3.4-1                                    amd64        Generic OpenCL ICD Loader
ii  ocl-icd-opencl-dev:amd64                         2.3.4-1                                    amd64        OpenCL development files
ii  opencl-c-headers                                 3.0~2025.07.22-2build1                     all          OpenCL (Open Computing Language) C header files
ii  opencl-clhpp-headers                             3.0~2025.07.22-1ubuntu2                    all          C++ headers for OpenCL development
ii  python3-bpfcc                                    0.35.0+ds-1ubuntu2                         all          Python 3 wrappers for BPF Compiler Collection (BCC)
ii  python3-idna                                     3.11-1ubuntu0.1                            all          Python IDNA2008 (RFC 5891) handling (Python 3)
ii  ristretto                                        0.13.4-1                                   amd64        lightweight picture-viewer for the Xfce desktop environment
ii  thunar                                           4.20.7-1                                   amd64        File Manager for Xfce
ii  wezterm                                          20240203-110809-5046fc22                   amd64        Wez's Terminal Emulator.
ii  xfburn                                           0.7.2-1build1                              amd64        CD-burner application for Xfce Desktop Environment
ii  xfce4-appfinder                                  4.20.0-2build1                             amd64        Application finder for the Xfce4 desktop environment
ii  xfce4-clipman                                    2:1.6.6-1build2                            amd64        clipboard history utility
ii  xfce4-clipman-plugin                             2:1.6.6-1build2                            amd64        clipboard history plugin for Xfce panel
ii  xfce4-cpugraph-plugin:amd64                      1.2.10-1build3                             amd64        CPU load graph plugin for the Xfce4 panel
ii  xfce4-dict                                       0.8.8-1build1                              amd64        Dictionary plugin for Xfce4 panel
ii  xfce4-helpers                                    4.20.1-1ubuntu2                            amd64        helpers for the Xfce4 desktop environment
ii  xfce4-indicator-plugin                           2.4.2-1build3                              amd64        plugin to display information from applications in the Xfce4 panel
ii  xfce4-mailwatch-plugin                           1.3.1-1build3                              amd64        mail watcher plugin for the Xfce4 panel
ii  xfce4-netload-plugin:amd64                       1.5.0-1                                    amd64        network load monitor plugin for the Xfce4 panel
ii  xfce4-notifyd                                    0.9.7-2build1                              amd64        simple, visually-appealing notification daemon for Xfce
ii  xfce4-panel                                      4.20.7-1                                   amd64        panel for Xfce4 desktop environment
ii  xfce4-panel-profiles                             1.0.15-1build1                             all          layout manager for the Xfce panel
ii  xfce4-places-plugin:amd64                        1.8.3-1build3                              amd64        quick access to folders, documents and removable media
ii  xfce4-power-manager                              4.20.0-1build1                             amd64        power manager for Xfce desktop
ii  xfce4-power-manager-data                         4.20.0-1build1                             all          power manager for Xfce desktop, arch-indep files
ii  xfce4-power-manager-plugins                      4.20.0-1build1                             amd64        power manager plugins for Xfce panel
ii  xfce4-pulseaudio-plugin:amd64                    0.5.1-1                                    amd64        Xfce4 panel plugin to control pulseaudio
ii  xfce4-screensaver                                4.20.1-1build1                             amd64        screen saver and locker that is integrated with the xfce4 desktop
ii  xfce4-screenshooter                              1.11.1-1build1                             amd64        screenshots utility for Xfce
ii  xfce4-session                                    4.20.4-1                                   amd64        Xfce4 Session Manager
ii  xfce4-settings                                   4.20.1-1ubuntu2                            amd64        graphical application for managing Xfce settings
ii  xfce4-systemload-plugin:amd64                    1:1.3.2-2ubuntu4                           amd64        system load monitor plugin for the Xfce4 panel
ii  xfce4-taskmanager                                1.5.8-1build1                              amd64        process manager for the Xfce4 Desktop Environment
ii  xfce4-terminal                                   1.1.5-1                                    amd64        Xfce terminal emulator
ii  xfce4-verve-plugin:amd64                         2.0.3-1build3                              amd64        Verve (command line) plugin for Xfce panel
ii  xfce4-weather-plugin:amd64                       0.12.0-1build1                             amd64        weather information plugin for the Xfce4 panel
ii  xfce4-whiskermenu-plugin                         2.10.1-1                                   amd64        Alternate menu plugin for the Xfce desktop environment
ii  xfce4-xkb-plugin:amd64                           1:0.8.5-1build1                            amd64        xkb layout switch plugin for the Xfce4 panel
ii  xfconf                                           4.20.0-1build1                             amd64        utilities for managing settings in Xfce
ii  xfdesktop4                                       4.20.1-1ubuntu2                            amd64        Xfce desktop background, icons and root menu manager
ii  xfdesktop4-data                                  4.20.1-1ubuntu2                            all          Xfce desktop background, icons and root menu (common files)
ii  xfwm4                                            4.20.0-1build1                             amd64        window manager of the Xfce project

Driver Installation Details

Download deb files in https://github.com/intel/compute-runtime/releases/tag/26.31.39395.13.
sudo dpkg -i *.deb.

Linux Distribution

Other (please specify below)

Other Linux Distribution

Ubuntu 26.04

Kernel Version & Boot Parameters

uname -r
7.0.0-30-generic

cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-7.0.0-30-generic root=UUID=19454695-456c-4aaf-ae90-ed26476bc394 ro quiet splash i915.force_probe=!56a0,!4682,!e223 xe.force_probe=56a0,4682,e223

lsmod | grep -E 'i915|xe'
xe                   4419584  15
drm_gpusvm_helper      57344  1 xe
gpu_sched              69632  1 xe
drm_gpuvm              57344  1 xe
drm_buddy              28672  1 xe
drm_ttm_helper         20480  1 xe
ttm                   135168  2 drm_ttm_helper,xe
drm_exec               12288  2 drm_gpuvm,xe
drm_suballoc_helper    24576  1 xe
drm_display_helper    303104  1 xe
cec                   106496  2 drm_display_helper,xe
i2c_algo_bit           16384  1 xe
intel_vsec             24576  3 intel_pmc_ssram_telemetry,pmt_telemetry,xe
video                  77824  1 xe

Actual Behavior

sycl::malloc_device() failed when allocate memory size is more than 19.4GB, through the "Max memory allocation" is 30.3GB (clinfo) on B70.
When allocate <=19.3GB, it's successful.

Expected Behavior

sycl::malloc_device() should be successful when allocate memory size<= 30.3GB (Max memory allocation) on B70.
When allocate <=19.3GB, it's successful.

Reproduction Rate

Always reproduces - 100%

Steps to Reproduce

icpx -fsycl -o alloc_20gb alloc_20gb.cpp
./alloc_20gb 19.3
./alloc_20gb 19.4

alloc_20gb.cpp

#include <sycl/sycl.hpp>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <chrono>
#include <thread>

uint64_t get_free_intel_gpu_memory(const sycl::queue &q)
{
    const sycl::device dev = q.get_device();

    if (!dev.has(sycl::aspect::ext_intel_free_memory))
    {
        return 0;
    }

    try
    {
        return dev.get_info<sycl::ext::intel::info::device::free_memory>();
    }
    catch (const sycl::exception &)
    {
        return 0;
    }
}

uint64_t get_gpu_max_memory_allocation(const sycl::queue &q)
{
    const sycl::device dev = q.get_device();

    try
    {
        return static_cast<uint64_t>(
            dev.get_info<sycl::info::device::max_mem_alloc_size>());
    }
    catch (const sycl::exception &)
    {
        return 0;
    }
}

int main(int argc, char *argv[])
{
    try
    {
        float max_size_g = 19.0f;
        if (argc > 1)
        {
            try
            {
                max_size_g = std::stof(argv[1]);
            }
            catch (const std::exception &)
            {
                max_size_g = 19.0f;
            }
        }

        sycl::queue q(sycl::gpu_selector_v);

        std::cout << "SYCL device: " << q.get_device().get_info<sycl::info::device::name>() << "\n\n";
        std::cout << "GPU max memory allocation: "
                  << std::fixed << std::setprecision(2)
                  << get_gpu_max_memory_allocation(q) / (1024.0 * 1024.0 * 1024.0)
                  << " GiB\n\n";
        const size_t one_gib = static_cast<size_t>(max_size_g * 1024ULL * 1024ULL * 1024ULL);
        std::vector<void *> allocations;

        std::cout << "Starting allocations...\n\n";

        for (int i = 1; i <= 1; ++i)
        {
            std::cout << "=== Allocation " << max_size_g << "(GiB) ===\n";

            std::cout << "Free Intel GPU memory BEFORE: "
                      << std::fixed << std::setprecision(2)
                      << get_free_intel_gpu_memory(q) / (1024.0 * 1024.0) << " MiB\n";

            void *dev_ptr = sycl::malloc_device(one_gib, q);

            if (dev_ptr == nullptr)
            {
                std::cerr << "Failed to allocate " << max_size_g << " GiB on device!\n";
                break;
            }

            allocations.push_back(dev_ptr);

            std::cout << "Successfully allocated " << max_size_g << " GiB at: " << dev_ptr << "\n";
            std::cout << "Free Intel GPU memory AFTER : "
                      << std::fixed << std::setprecision(2)
                      << get_free_intel_gpu_memory(q) / (1024.0 * 1024.0) << " MiB\n\n";
        }

        // Keep memory allocated until user presses a key or program ends
        std::cout << "Memory will be released when the program ends.\n";

        // Free all allocations at the end
        std::cout << "Freeing all device memory...\n";
        for (auto ptr : allocations)
        {
            sycl::free(ptr, q);
        }

        std::cout << "All device memory freed.\n";
    }
    catch (const sycl::exception &e)
    {
        std::cerr << "SYCL exception: " << e.what() << std::endl;
        return 1;
    }

    return 0;
}

Is this a regression?

  • Yes, this is a regression - functionality that previously worked is now broken

Last Known Working Driver Version

No response

First Known Failing Driver Version

No response

API Call Logs

19.3 GB - passed

./alloc_20gb 19.3
SYCL device: Intel(R) Arc(TM) Pro B70 Graphics

GPU max memory allocation: 30.30 GiB

Starting allocations...

=== Allocation 19.30(GiB) ===
Free Intel GPU memory BEFORE: 32586.04 MiB
Successfully allocated 19.30 GiB at: 0xffffd556b6400000
Free Intel GPU memory AFTER : 12822.70 MiB

Memory will be released when the program ends.
Freeing all device memory...
All device memory freed.

19.4GB - failed

./alloc_20gb 19.4
SYCL device: Intel(R) Arc(TM) Pro B70 Graphics

GPU max memory allocation: 30.30 GiB

Starting allocations...

=== Allocation 19.40(GiB) ===
Free Intel GPU memory BEFORE: 32586.04 MiB
Failed to allocate 19.4 GiB on device!
Memory will be released when the program ends.
Freeing all device memory...
All device memory freed.

strace Logs

No response

System Logs / dmesg Output

No response

Backtrace (if crash or hang occurred)

No response

Source Code / Reproducer

No response

Command Line / Application Details

No response

oneAPI Version (if applicable)

No response

Screenshots / Video

No response

Additional Notes

It's impact the llama.cpp SYCL backend. Refer to issue: ggml-org/llama.cpp#28778

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS: LinuxIssue specific to Linux distributions (Ubuntu, Fedora, RHEL, etc.)Type: BugGeneral bug report, unexpected behavior or crash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions