Skip to content

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Sep 8, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2025

@llvm/pr-subscribers-offload

Author: Joseph Huber (jhuber6)

Changes

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

1 Files Affected:

  • (modified) offload/test/lit.cfg (+1-1)
diff --git a/offload/test/lit.cfg b/offload/test/lit.cfg
index f3e8e9a66685e..a41bcb9c0d064 100644
--- a/offload/test/lit.cfg
+++ b/offload/test/lit.cfg
@@ -169,7 +169,7 @@ else: # Unices
     if config.cuda_libdir:
         config.test_flags += " -Wl,-rpath," + config.cuda_libdir
     if config.libomptarget_current_target.startswith('nvptx'):
-        config.test_flags_clang += " --libomptarget-nvptx-bc-path=" + config.llvm_library_intdir
+        config.test_flags_clang += " --libomptarget-nvptx-bc-path=" + config.llvm_library_intdir + "/nvptx64-nvidia-cuda"
     if config.libomptarget_current_target.endswith('-LTO'):
         config.test_flags += " -foffload-lto"
     if config.libomptarget_current_target.endswith('-JIT-LTO') and evaluate_bool_env(

config.test_flags += " -Wl,-rpath," + config.cuda_libdir
if config.libomptarget_current_target.startswith('nvptx'):
config.test_flags_clang += " --libomptarget-nvptx-bc-path=" + config.llvm_library_intdir
config.test_flags_clang += " --libomptarget-nvptx-bc-path=" + config.llvm_library_intdir + "/nvptx64-nvidia-cuda"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, config.llvm_library_intdir is /home/jdenny/llvm/build/lib. But the file that's needed is /home/jdenny/llvm/build/runtimes/runtimes-nvptx64-nvidia-cuda-bins/openmp/device/libomptarget-nvptx.bc. So the above doesn't fix the problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought at one point we set the intermediate directory for those bitcode files explicitly to config.llvm_library_intdir.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not getting installed there? It's supposed to be installed to build/lib/nvptx64-nvidia-cuda but it's possible something's messed up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick fix, likely what we want is to inform the runtimes which targets are active or something.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ ls build/lib/nvptx64-nvidia-cuda/
crt1.o  libc.a  libm.a  libompdevice.a

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not installing before testing. But I thought you were pointing to a build directory anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to specify the output to the right place, should hopefully work now.

Copy link
Collaborator

@jdenny-ornl jdenny-ornl Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clean build (on my amd gpu system or nvidia gpu system) now fails with something like:

ninja: error: 'openmp/device/libomptarget-amdgpu.bc', needed by '/home/jdenny/llvm/build/lib/amdgcn-amd-amdhsa/libompdevice.a', missing and no known rule to make it

I have not pulled since this morning. I only applied your diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. Thanks.

@llvmbot llvmbot added openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime labels Sep 8, 2025
@jhuber6 jhuber6 merged commit 6d032c4 into llvm:main Sep 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

offload openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants