Nondeterministic behavior occurs when operations are launched in more than one CUDA stream. To avoid this, set the environment varibale CUBLAS_WORKSPACE_CONFIG to :16:8 to only use one buffer size during runtime.