This commit is contained in:
c4ch3c4d3
2026-04-01 17:09:27 -06:00
parent a2d4f9d86d
commit 30b919c0b9
7 changed files with 328 additions and 89 deletions
+35 -14
View File
@@ -112,16 +112,39 @@ host_is_wsl() {
[ "$(uname -s)" = "Linux" ] && uname -r | grep -qiE 'microsoft|wsl'
}
host_is_arm_mac() {
[ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]
host_is_macos() {
[ "$(uname -s)" = "Darwin" ]
}
check_wsl_gpu_readiness() {
if host_is_arm_mac; then
host_is_linux() {
[ "$(uname -s)" = "Linux" ]
}
host_is_arm_mac() {
host_is_macos && [ "$(uname -m)" = "arm64" ]
}
host_profile() {
if host_is_wsl; then
printf '%s\n' "wsl"
return
fi
if ! host_is_wsl; then
if host_is_macos; then
printf '%s\n' "macos"
return
fi
if host_is_linux && host_is_debian_family; then
printf '%s\n' "native-debian-ubuntu"
return
fi
printf '%s\n' "unsupported"
}
check_wsl_gpu_readiness() {
if [ "$(host_profile)" != "wsl" ]; then
return
fi
@@ -153,6 +176,12 @@ EOF
linux_cuda_toolkit_is_ready() {
command -v nvcc >/dev/null 2>&1 && return 0
[ -x /usr/local/cuda/bin/nvcc ] && return 0
for candidate in /usr/local/cuda-*/bin/nvcc; do
if [ -x "$candidate" ]; then
return 0
fi
done
[ -f /usr/local/cuda/include/cuda_runtime.h ] && return 0
[ -f /usr/include/cuda_runtime.h ] && return 0
return 1
@@ -213,15 +242,7 @@ EOF
}
check_linux_cuda_toolkit() {
if host_is_arm_mac; then
return
fi
if [ "$(uname -s)" != "Linux" ]; then
return
fi
if host_is_wsl; then
if [ "$(host_profile)" != "native-debian-ubuntu" ]; then
return
fi