Conversation
This reverts commit 0f06b7a.
|
@Nuck-TH You can download PhysX SDK samples from here: https://developer.download.nvidia.com/PhysX/2.8.1/PhysX_2.8.1_SDK_Core.msi You can also try fluidmark (support added today): https://www.geeks3d.com/20130308/fluidmark-1-5-1-physx-benchmark-fluid-sph-simulation-opengl-download/ |
|
Next bunch(Alice): Do i need both logs or one(which) is sufficient? Fluidmark gets stuck at initializing fluid 0%, nvidia samples segfault. If fluidmark is started any(x64/i686) zluda.exe - it errors out with "could not load particle texture". Also, for some reason, zluda stopped creating cahe file, even if i run precompile...
Did what is told in OP
|
|
Managed to get Mirror's Edge working with this - followed the steps provided here and then all the steps under the "Install and enable the latest PhysX update" section on PCGamingWiki so that the game uses the newer version of PhysX and loads the ZLUDA DLLs along with it. Settings used: Run-through of chapter 1 (checkpoint B): https://youtu.be/_wMEfFz_KLQ Notes:
zluda_trace compressed log.txt (different run from the recording but same level): zluda_trace.zip - I can provide the full log output if needed. |
|
This is what i get after just installing this and moving to HIP nightlies This got FluidMark and nvidia samples working :) |
Thank you! Worked fine on my end following your instructions. Here's some recordings: 2026-07-05_13-38-42_1.mp4ZLUDA ON 2026-07-05_13-43-12_1.mp4Hardware: Edit: test with Batman Arkham Origins, framerate wasn't that bad running on the CPU but was a lot choppy too. ZLUDA OFF 2026-07-05_16-08-11_1.mp4ZLUDA ON 2026-07-05_16-13-33_1.mp4 |
|
@Nuck-TH try the most recent commit, it should work with Alice: Madness Returns now As for performance, in general there's not much improvement to be made. Maybe by redoing the communication between 32-bit ZLUDA and 64-bit server from named pipes to shared memory. But that's a bit tricky. Thanks for testing it, I did not consider installing latest physx system-wide (I already had it installed by the NV drivers). I'll be focusing on cleaning it up for merge and updating documentation (turns out you don't need to put nvcuda.dll in syswow64, you can just launch from steam by setting the command to |
|
After this changes Alice actually works \^_^/ Though some effects lower fps still, which is odd for a game that uses phys for very few select things. Seems like RPC is bottleneck after all, because compute load doesn't rise beyond certain amount(same as with FluidMark). Probably implementation of integration into engine and/or effects is bad and spams too much calls. I wouldn't be surprised, because it works horribly on CPU. But there is peculiarity with zluda.exe - if i run the game via 64bit one i don't get any trace log. If i run with 32bit one - physx fails exact same way as in comment #4885364121... So i can't capture trace of things working. Another thing is that there are issues with reinitializing physics - in fluidmark if you start and abort test/benchmark a few times it eventually fails and falls back to cpu. Same with nvidia samples(like SampleCloth.exe) that can switch scenes or toggle hardware acceleration. |
|
Running with 64 bit zluda.exe will do nothing, you need to run 32 bit zluda.exe: those two are different and each only works with their corresponding bitness. I want to eventually provide a single loader that supports any bitness, but that will have to wait. The best way to run it is to change your Steam launch options to As for reinitialization I agree it's a problem, I'll work on it after merging this PR. Thanks for testing |
As i written - i figured as much.
I know, yet:
Physx works if game is run by itself, but not if via 32bit zluda executable. |
|
If it's a Steam game, it doesn't work if you start it through zluda.exe outside of Steam. The game executable instead of running normally goes into special mode where it messages Steam to do the actual launch and it closes. Then Steam relaunches it, totally separately and outside of zluda.exe control |
|
Looks promising. Linux, WINE basic wow64 unixlib. |
There was a problem hiding this comment.
Pull request overview
This PR introduces an early/experimental 32-bit CUDA support path by adding a 32-bit nvcuda.dll shim that IPCs into a 64-bit CUDA “server”, plus associated metadata plumbing (kernel arg layouts, globals) and packaging/CI updates to build and ship both 64-bit and 32-bit artifacts.
Changes:
- Add new
zluda32(32-bitnvcuda.dll) andzluda64_server(64-bit named-pipe server) with a shared wire protocol inzluda_server_common. - Extend PTX/LLVM pipeline + kernel metadata to carry 32-bit-specific globals and explicit argument size/align info.
- Add NVAPI stub + NVAPI tracing, update tracing/logging ABI, and update
xtask+ CI workflows to produce 32-bit zip outputs.
Reviewed changes
Copilot reviewed 53 out of 56 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
zluda64_server/src/main.rs |
New 64-bit CUDA server handling IPC opcodes and emulating 32-bit pointers/handles. |
zluda64_server/Cargo.toml |
New crate manifest for the 64-bit server binary. |
zluda32/src/lib.rs |
New 32-bit nvcuda shim exporting CUDA driver API and forwarding via IPC. |
zluda32/src/ipc.rs |
New Windows named-pipe IPC + child-process spawning for the 64-bit server. |
zluda32/Cargo.toml |
New crate manifest for the 32-bit nvcuda cdylib. |
zluda/src/impl/tex.rs |
Handle null device pointer by unbinding texture in ref_set_address_v2. |
zluda/src/impl/module.rs |
Add optional 32-bit metadata (globals + explicit arg layouts) to modules and cache pipeline. |
zluda/src/impl/library.rs |
Thread 32-bit module metadata through lazy module initialization. |
zluda/src/impl/hipfix.rs |
Avoid touching texture objects when none is set. |
zluda/src/impl/function.rs |
Store optional explicit arg size/align metadata on functions. |
zluda/src/impl/driver.rs |
Fix CLS handling of null context and expose a ZLUDA32 dark API export table. |
zluda_windows/src/lib.rs |
Add NVAPI library entry, 32-bit library list split, and kill_child_on_process_exit helper. |
zluda_trace/src/trace.rs |
Adjust fatbin/PTX extraction to optionally strip trailing zero. |
zluda_trace/src/log.rs |
Add NVAPI function-name variant for logging. |
zluda_trace/src/lib.rs |
Update logged-call ABI to include NVAPI interface id; add platform Drop cleanup. |
zluda_trace/Cargo.toml |
Update dynasm/dynasmrt versions; mark crate as 32-bit-capable in metadata. |
zluda_trace_sparse/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_trace_nvml/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_trace_fft/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_trace_dnn9/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_trace_dnn8/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_trace_blaslt/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_trace_blas/src/lib.rs |
Pass new nvapi_interface parameter (0) to trace export table. |
zluda_server_common/src/lib.rs |
New wire protocol: opcode enum + message structs + 32-bit encoding helpers. |
zluda_server_common/Cargo.toml |
New crate manifest for the shared server protocol. |
zluda_redirect/Cargo.toml |
Mark redirect crate as 32-bit-capable in metadata. |
zluda_inject/src/bin.rs |
Reuse zluda_windows::kill_child_on_process_exit helper. |
zluda_inject/Cargo.toml |
Remove direct JobObjects dependency; mark as 32-bit-capable in metadata. |
zluda_dnn9/Cargo.toml |
Relax rand version requirement to 0.9. |
zluda_common/src/os_win.rs |
Fix function-pointer-to-usize cast. |
zluda_common/src/lib.rs |
Gate some transmute-based FromCuda impls to 64-bit builds. |
zluda_common/src/constants.rs |
Gate 64-bit-only constant to 64-bit builds. |
xtask/src/main.rs |
Add --target support, 32-bit project filtering, and per-arch windows_paths selection. |
ptx/src/test/spirv_run/mod.rs |
Update tests for new explicit arg size/align metadata shape. |
ptx/src/pass/replace_instructions_with_functions.rs |
Adjust dtype handling for 32-bit texture path. |
ptx/src/pass/llvm/emit.rs |
Skip pointer space conversions when using base 32-bit memory mapping. |
ptx/src/pass/convert_32bit_to_64bit.rs |
Record explicit argument size/align per kernel (replacing arg-count-only metadata). |
ptx/lib/zluda_ptx_impl.cpp |
Formatting-only tweak. |
ptx_parser/src/lib.rs |
Extend parser to accept .u32 dtype in relevant grammar. |
ptx_parser/Cargo.toml |
Bump strum to 0.28. |
nvapi/src/lib.rs |
New NVAPI stub library with nvapi_QueryInterface and a small set of implementations. |
nvapi/Cargo.toml |
New NVAPI crate manifest and packaging metadata for 32-bit/trace outputs. |
nvapi_trace/src/lib.rs |
New NVAPI tracing shim that logs calls through the trace export table. |
nvapi_trace/Cargo.toml |
New manifest for NVAPI tracing shim (includes dynasm for x86 thunks). |
kernel_metadata/src/lib.rs |
Change 32-bit metadata from arg-count to explicit arg size/align vector. |
dark_api/src/lib.rs |
Extend trace ABI with NVAPI interface id; add FunctionArgInfo; add ZLUDA32 internal dark API. |
dark_api/src/fatbin.rs |
Add optional “strip trailing zero” behavior when decompressing payloads. |
dark_api/Cargo.toml |
Add rkyv dependency. |
cuda_types/src/dark_api.rs |
Add CUDA / OpenCL fatbin header flags. |
cuda_macros/src/lib.rs |
Add proc-macros for generating IPC input/output structs and wire-object field handling. |
cuda_check/Cargo.toml |
Relax rand version requirement to 0.9. |
Cargo.toml |
Add new workspace members (zluda32, zluda64_server, nvapi, nvapi_trace, zluda_server_common). |
.github/workflows/push_master.yml |
Build/package a 32-bit zip alongside 64-bit; exclude new crates from test bundle. |
.github/workflows/pr_master.yml |
Same as above for PR CI workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Now that it has been merged, please move follow-up discussion to Issues/Discussion in this repo or to Discord. |


This is far from ready, but if one is inclined to try it the steps are. Just remember you do this at your own risk:
zluda32\src\ipc.rsfromC:\dev\ZLUDAto whatever is your pathcargo xtask -randcargo xtask --target=i686-pc-windows-msvc -rtarget\i686-pc-windows-msvc\releasetoC:\Windows\SysWOW64