Skip to content

fix(cuda,tests): Ensure CUDA device selection before GPU allocations#28

Merged
GuyPaddock merged 2 commits intocodex/fix-failing-ci-pipeline-jobsfrom
codex/fix-tests-failing-with-m40-card
Dec 21, 2025
Merged

fix(cuda,tests): Ensure CUDA device selection before GPU allocations#28
GuyPaddock merged 2 commits intocodex/fix-failing-ci-pipeline-jobsfrom
codex/fix-tests-failing-with-m40-card

Conversation

@GuyPaddock
Copy link
Owner

Summary

  • validate cudaSetDevice during context creation and guard device selection for allocations
  • guard KV cache creation and device malloc with device-selection helper to avoid null returns when device is not current

Testing

  • not run (not available in container)

Codex Task

Ensure CUDA calls run on the selected device before allocating memory.
- Validate cudaSetDevice during context creation.
- Reuse device guard to prevent cudaMalloc failures when the device is not current.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Ensure m40llm_create_context returns null without referencing an undefined context pointer when cudaSetDevice fails.
@GuyPaddock GuyPaddock changed the title Ensure CUDA device selection before GPU allocations fix(cuda,tests): Ensure CUDA device selection before GPU allocations Dec 21, 2025
@GuyPaddock GuyPaddock merged commit d898562 into codex/fix-failing-ci-pipeline-jobs Dec 21, 2025
1 of 3 checks passed
@GuyPaddock GuyPaddock deleted the codex/fix-tests-failing-with-m40-card branch December 21, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant