Hello,
I have a persistent issue where any model run via the cmdstanr backend fails instantly. The model compiles successfully, but when sampling starts, the chains finish unexpectedly with no log output files created.
Crucially, this problem is NOT related to parallelism. The crash occurs:
-
With OpenCL (
opencl = c(0, 0)). -
With CPU threading (
threads = threading(...)). -
Even in the simplest serial mode (
cores = 1,chains = 1).
However, if I comment out backend = "cmdstanr" and let brms use the default rstan backend, the model runs perfectly with parallel chains (cores > 1).
This proves the issue is specific to the executables generated and/or run by the cmdstanr backend on my system.
Here is the complete output from the diagnostic guide suggested on another thread:
--- Checking Versions ---
[1] "2.37.0"
--- Checking the Toolchain ---
The C++ toolchain required for CmdStan is setup properly!
--- Checking the PATH variable ---
[1] "C:\\RBuildTools\\4.4\\x86_64-w64-mingw32.static.posix\\bin;C:\\RBuildTools\\4.4\\usr\\bin;C:\\Program Files\\R\\R-4.4.2\\bin\\x64;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v13.0\\bin\\x64;C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Windows\\System32;C:\\Windows;C:\\Windows\\System32\\wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2025.3.1;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Users\\Usuario\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Usuario\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64;C:\\Users\\Usuario\\AppData\\Roaming\\TinyTeX\\bin\\win32;C:\\Program Files\\RStudio\\resources\\app\\bin\\quarto\\bin;C:\\Program Files\\RStudio\\resources\\app\\bin\\postback"
--- Testing the execution of the Bernoulli model ---
Model executable is up to date!
Running MCMC with 1 chain...
Chain 1 finished unexpectedly!
Error : Fitting failed. Unable to print.
--- END OF DIAGNOSTIC GUIDE ---
And here is my system information:
-
Operating System: Windows 11
-
CmdStan Version: 2.37.0
-
CmdStanR Version: 0.9.0.9000
-
Compiler/Toolkit: Rtools44
-
GPU Model: NVIDIA GeForce GTX 1050 Ti
-
NVIDIA Driver Version: NVIDIA Studio v 581.57
I have already tried a full clean install of the NVIDIA Studio Driver and completely disabling all antivirus/firewall software, but the problem persists.
Thank you for any help you can provide.