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

fix: better CUDA detection #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

delehef
Copy link

@delehef delehef commented Dec 11, 2024

What ❔

This PR improves the detection of the CUDA toolkit under Linux, and the detection of its version under all OSes.

Why ❔

Under Linux, the CUDA detection is hardcoded to look into /usr/local/cuda, which is not guaranteed to be the default installation folder. The new method first looks for the CUDA_PATH env. var., then default to /usr/local/cuda if it is empty.

The current way of finding out the installed CUDA version is to look for a version.json file in the CUDA installation path. This file is not guaranteed to exist. However, nvcc is guaranteed to be installed with the toolkit; so the new method is to parse its output to find the exact version there.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.

@delehef delehef force-pushed the fix/cuda-version-detection branch from c20bdf5 to 3ffdcf3 Compare December 19, 2024 10:06
@delehef delehef force-pushed the fix/cuda-version-detection branch from 3ffdcf3 to 3c409f7 Compare December 19, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants