Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Driver] Pass --cuda-path to test #117415

Merged
merged 2 commits into from
Nov 26, 2024
Merged

[Driver] Pass --cuda-path to test #117415

merged 2 commits into from
Nov 26, 2024

Conversation

bzEq
Copy link
Collaborator

@bzEq bzEq commented Nov 23, 2024

My local build, on Debian GNU/Linux 12 (bookworm), complains

clang: error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/lib/cuda is 11.8; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'

Fix it by passing --cuda-path. Hope this doesn't affect the original intention of the test.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Nov 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 23, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Kai Luo (bzEq)

Changes

My local build, on Debian GNU/Linux 12 (bookworm), complains

clang: error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/lib/cuda is 11.8; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'

Fix it by passing --no-cuda-version-check.


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

1 Files Affected:

  • (modified) clang/test/Driver/cuda-no-threadsafe-statics.cu (+1-1)
diff --git a/clang/test/Driver/cuda-no-threadsafe-statics.cu b/clang/test/Driver/cuda-no-threadsafe-statics.cu
index eb15312f8f7d14..494f0e7a89ff32 100644
--- a/clang/test/Driver/cuda-no-threadsafe-statics.cu
+++ b/clang/test/Driver/cuda-no-threadsafe-statics.cu
@@ -2,7 +2,7 @@
 // compilation only.
 //
 // RUN: %clang -### -x cuda --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s \
-// RUN:            -nocudainc -nocudalib 2>&1 | FileCheck %s
+// RUN:            -nocudainc -nocudalib --no-cuda-version-check 2>&1 | FileCheck %s
 
 // RUN: %clang -### -x hip --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx1010 %s \
 // RUN:            -nocudainc -nocudalib 2>&1 | FileCheck %s

@Artem-B
Copy link
Member

Artem-B commented Nov 25, 2024

I am surprised that this is needed. I suspect clang picks the default CUDA version on your machine.

While --no-cuda-version-check will make the test work, it will still pick CUDA installation outside of the source tree, and then suppress the error.

A better way to fix this may be to pass --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda and make the test hermetic.

My local build, on Debian GNU/Linux 12 (bookworm), complains
```
clang: error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/lib/cuda is 11.8; use '--cuda-path' to specify a different CUDA install, pass a different GPU arch with '--cuda-gpu-arch', or pass '--no-cuda-version-check'
```

Fix it by passing `--no-cuda-version-check`.
@bzEq
Copy link
Collaborator Author

bzEq commented Nov 25, 2024

Address comment.

@bzEq bzEq changed the title [Driver] Pass --no-cuda-version-check to test [Driver] Pass --cuda-path to test Nov 25, 2024
@bzEq bzEq merged commit 97fe5fa into llvm:main Nov 26, 2024
6 of 7 checks passed
@bzEq bzEq deleted the no-cuda-version-check branch November 26, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants