Skip to content

Allow users to set paths to CUDA_HOME and CUDA_PATH in env#1

Open
mzweilin wants to merge 1 commit into
gpusgobrr:mainfrom
mzweilin:mzweilin/allow_overriding_cuda_path
Open

Allow users to set paths to CUDA_HOME and CUDA_PATH in env#1
mzweilin wants to merge 1 commit into
gpusgobrr:mainfrom
mzweilin:mzweilin/allow_overriding_cuda_path

Conversation

@mzweilin
Copy link
Copy Markdown

Some users like us may have CUDA installed in an unusual path. We cannot not change it as non-sudoers.

This pull request updates how CUDA environment variables are set in several Python files to make the code more robust. Instead of unconditionally overwriting existing environment variables, it now uses os.environ.setdefault to only set CUDA_HOME and CUDA_PATH if they are not already defined. This prevents accidental overwriting of user- or system-defined values and improves compatibility across different environments.

Environment variable handling improvements:

  • Replaced unconditional assignment of CUDA_HOME and CUDA_PATH with os.environ.setdefault in autotune_cutlass.py, autotune_cutlass_hopper.py, benchmark.py, kernel_runner.py, and test_kernels.py, ensuring existing environment values are preserved if already set. [1] [2] [3] [4] [5]

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