Skip to content

Commit

Permalink
[SYCL][E2E] Fix CUDA_PATH when only default installation exists. (i…
Browse files Browse the repository at this point in the history
…ntel#14514)

The existing script searches for the latest CUDA installation, excluding
the default installation. This patch ensures the script can recognize
and utilize the installation located at `/usr/local/cuda` when it is the
only one available.
  • Loading branch information
mmoadeli authored and hdelan committed Jul 26, 2024
1 parent 910fc40 commit 1bca82b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
) # PVC-VG implies the support of FP16 matrix
config.available_features.add(
"matrix-tf32"
) # PVC-VG implies the support of TF32 matrix
) # PVC-VG implies the support of TF32 matrix
if lit_config.params.get("matrix", False):
config.available_features.add("matrix")

Expand Down Expand Up @@ -499,12 +499,15 @@ def open_check_file(file_name):
r"^\d+\.\d+$", version
): # Match version pattern like 12.3
cuda_versions.append(version)
latest_cuda_version = max(
cuda_versions, key=lambda v: [int(i) for i in v.split(".")]
)
os.environ["CUDA_PATH"] = os.path.join(
cuda_root, f"cuda-{latest_cuda_version}"
)
if cuda_versions:
latest_cuda_version = max(
cuda_versions, key=lambda v: [int(i) for i in v.split(".")]
)
os.environ["CUDA_PATH"] = os.path.join(
cuda_root, f"cuda-{latest_cuda_version}"
)
elif os.path.exists(os.path.join(cuda_root, "cuda")):
os.environ["CUDA_PATH"] = os.path.join(cuda_root, "cuda")

if "CUDA_PATH" not in os.environ:
lit_config.error("Cannot run tests for CUDA without valid CUDA_PATH.")
Expand Down

0 comments on commit 1bca82b

Please sign in to comment.