Skip to content

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.

@bzEq bzEq requested review from Artem-B, pogo59 and yxsamliu November 23, 2024 05:21
@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.

bzEq added 2 commits November 26, 2024 07:25
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 bzEq force-pushed the no-cuda-version-check branch from eb0bc0b to 253a669 Compare November 25, 2024 23:47
@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