Skip to content

Fix torch errors - #3

Merged
thammel merged 1 commit into
masterfrom
fix/release
Mar 24, 2026
Merged

Fix torch errors#3
thammel merged 1 commit into
masterfrom
fix/release

Conversation

@thammel

@thammel thammel commented Mar 24, 2026

Copy link
Copy Markdown
Owner

No description provided.

@thammel
thammel merged commit 21ca57f into master Mar 24, 2026
2 checks passed

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

Copy link
Copy Markdown

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.

Reviewed commit: bed2d7a419

ℹ️ 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".

Comment thread hooks/pyi_rth_torch.py
if sys.platform == 'win32' and hasattr(sys, '_MEIPASS'):
torch_lib = os.path.join(sys._MEIPASS, 'torch', 'lib')
if os.path.isdir(torch_lib):
os.add_dll_directory(torch_lib)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Persist DLL directory handle in runtime hook

os.add_dll_directory() returns a handle that must remain alive for the directory to stay on the DLL search path, but this call discards the handle immediately. On Windows/CPython that means the added torch/lib path can be removed before torch is imported from the app, so the original WinError 1114 failure can still occur despite this hook. Store the returned handle in a module-level variable (or list) for process lifetime.

Useful? React with 👍 / 👎.

@thammel
thammel deleted the fix/release branch March 24, 2026 12:51
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.

1 participant