Skip to content

[Offload][lit] Link against SPIR-V DeviceRTL if present#180030

Merged
sarnex merged 1 commit intollvm:mainfrom
sarnex:offloadlit
Feb 5, 2026
Merged

[Offload][lit] Link against SPIR-V DeviceRTL if present#180030
sarnex merged 1 commit intollvm:mainfrom
sarnex:offloadlit

Conversation

@sarnex
Copy link
Copy Markdown
Member

@sarnex sarnex commented Feb 5, 2026

Right now if we run check-offload for SPIR-V the DeviceRTL isn't used because we pass -nogpulib.

Don't pass that, but also don't pass --libomptarget-spirv-bc-path yet because the DeviceRTL is brand new so we don't want to error if it's not present.

@sarnex sarnex force-pushed the offloadlit branch 2 times, most recently from 9d16d55 to e7fe617 Compare February 5, 2026 20:57
@sarnex sarnex marked this pull request as ready for review February 5, 2026 21:16
@llvmbot llvmbot added the offload label Feb 5, 2026
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Feb 5, 2026

@llvm/pr-subscribers-offload

Author: Nick Sarnie (sarnex)

Changes

Right now if we run check-offload for SPIR-V the DeviceRTL isn't used because we pass -nogpulib.

Don't pass that, but also don't pass --libomptarget-spirv-bc-path yet because the DeviceRTL is brand new so we don't want to error if it's not present.


Full diff: https://github.com/llvm/llvm-project/pull/180030.diff

1 Files Affected:

  • (modified) offload/test/lit.cfg (+3-2)
diff --git a/offload/test/lit.cfg b/offload/test/lit.cfg
index 0d5a9c95c1d95..898258f3e3cd0 100644
--- a/offload/test/lit.cfg
+++ b/offload/test/lit.cfg
@@ -166,7 +166,8 @@ elif config.operating_system == 'Darwin':
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
 else: # Unices
-    if config.libomptarget_current_target != "nvptx64-nvidia-cuda":
+    if config.libomptarget_current_target != "nvptx64-nvidia-cuda" and \
+       not config.libomptarget_current_target.startswith('spirv'):
         config.test_flags += " -nogpulib"
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
@@ -214,7 +215,7 @@ def add_libraries(source):
     if "gpu" not in config.available_features:
         return source
     if "intelgpu" in config.available_features:
-        # There is no DeviceRTL for Intel yet and libc doesn't work.
+        # SPIR-V uses an out-of-tree linker and libc doesn't work.
         return source
     if config.libomptarget_has_libc:
         return source + " -Xoffload-linker -lc " + \

@sarnex sarnex requested review from jhuber6 and jplehr February 5, 2026 21:17
@sarnex sarnex merged commit b985974 into llvm:main Feb 5, 2026
13 checks passed
@llvm-ci
Copy link
Copy Markdown

llvm-ci commented Feb 5, 2026

LLVM Buildbot has detected a new failure on builder intel-sycl-gpu running on intel-sycl-gpu-01 while building offload at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/225/builds/2031

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'libomptarget :: spirv64-intel :: api/omp_target_memcpy_async1.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./bin/clang -fopenmp    -I /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/llvm-project/offload/test -I /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/openmp/runtime/src -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/openmp/runtime/src  -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib  -fopenmp-targets=spirv64-intel /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/llvm-project/offload/test/api/omp_target_memcpy_async1.c -o /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload/test/spirv64-intel/api/Output/omp_target_memcpy_async1.c.tmp && /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload/test/spirv64-intel/api/Output/omp_target_memcpy_async1.c.tmp
# executed command: /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./bin/clang -fopenmp -I /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/llvm-project/offload/test -I /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/openmp/runtime/src -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -L /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -Wl,-rpath,/home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/./lib -fopenmp-targets=spirv64-intel /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/llvm-project/offload/test/api/omp_target_memcpy_async1.c -o /home/test-user/llvm-buildbot-worker/intel-sycl-gpu/build/runtimes/runtimes-bins/offload/test/spirv64-intel/api/Output/omp_target_memcpy_async1.c.tmp
# .---command stderr------------
# | clang: error: no library 'libomptarget-spirv.bc' found in the default clang lib directory or in LIBRARY_PATH; use '--libomptarget-spirv-bc-path' to specify spirv bitcode library
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@jhuber6
Copy link
Copy Markdown
Contributor

jhuber6 commented Feb 5, 2026

I thought we linked the .a? The .bc should honestly be removed if we get NVPTX touse LTO by default.

@sarnex
Copy link
Copy Markdown
Member Author

sarnex commented Feb 6, 2026

We aren't building the DeviceRTL yet on the buildbot. Let me revert this so I can merge it at the same time as llvm-zorg changes to prevent CI failures

sarnex added a commit that referenced this pull request Feb 6, 2026
sarnex added a commit that referenced this pull request Feb 6, 2026
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Feb 6, 2026
…esent" (#180211)

Reverts llvm/llvm-project#180030

Need to make changes to buildbot first
sarnex added a commit to sarnex/llvm-project that referenced this pull request Feb 6, 2026
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Feb 6, 2026
Right now if we run `check-offload` for SPIR-V the DeviceRTL isn't used
because we pass `-nogpulib`.

Don't pass that, but also don't pass `--libomptarget-spirv-bc-path` yet
because the DeviceRTL is brand new so we don't want to error if it's not
present.

Signed-off-by: Nick Sarnie <[email protected]>
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Feb 6, 2026
rishabhmadan19 pushed a commit to rishabhmadan19/llvm-project that referenced this pull request Feb 9, 2026
Right now if we run `check-offload` for SPIR-V the DeviceRTL isn't used
because we pass `-nogpulib`.

Don't pass that, but also don't pass `--libomptarget-spirv-bc-path` yet
because the DeviceRTL is brand new so we don't want to error if it's not
present.

Signed-off-by: Nick Sarnie <[email protected]>
rishabhmadan19 pushed a commit to rishabhmadan19/llvm-project that referenced this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants