How to disable running logs of brian2cuda

brian2cuda output lots of logging information during running. Is there a way to disable them? I recall there was way to bypass it mentioned in the old chat list but the old chat doesn’t exist anymore. The following is the snapshot of those messages:

INFO _run_kernel_s_efe0to1_pre_plastic_codeobject: Using 1 threads per bundle
INFO _run_kernel_s_efe0to1_pre_plastic_codeobject
1 blocks
1024 threads
48 registers per thread
0 bytes statically-allocated shared memory per block
8 bytes local memory per thread
4392 bytes user-allocated constant memory
0.500 theoretical occupancy
INFO _run_kernel_s_input2e0_pre_plastic_codeobject: Using 1 threads per bundle
INFO _run_kernel_s_input2e0_pre_plastic_codeobject
1 blocks
1024 threads
48 registers per thread
0 bytes statically-allocated shared memory per block
8 bytes local memory per thread
4392 bytes user-allocated constant memory
0.500 theoretical occupancy
INFO _run_kernel_s_input2e1_pre_plastic_codeobject: Using 1 threads per bundle
INFO _run_kernel_s_input2e1_pre_plastic_codeobject
1 blocks
1024 threads
48 registers per thread
0 bytes statically-allocated shared memory per block
8 bytes local memory per thread
4392 bytes user-allocated constant memory
0.500 theoretical occupancy
INFO _run_kernel_s_efe0to1_post_codeobject: Using 1 threads per bundle
INFO _run_kernel_s_efe0to1_post_codeobject
1 blocks
1024 threads
48 registers per thread
0 bytes statically-allocated shared memory per block
8 bytes local memory per thread
4392 bytes user-allocated constant memory
0.500 theoretical occupancy
INFO _run_kernel_s_input2e0_post_codeobject: Using 1 threads per bundle
INFO _run_kernel_s_input2e0_post_codeobject
1 blocks
1024 threads
48 registers per thread
0 bytes statically-allocated shared memory per block
8 bytes local memory per thread
4392 bytes user-allocated constant memory

Hi @DavidKing2020 . At the moment, there is no fine-grained way to toggle Brian2CUDA’s log messages (see Implement a logging system on C++/CUDA level · Issue #103 · brian-team/brian2cuda · GitHub). You should be able to completely switch off its output, though, by using the with_output argument. If you use a single run (i.e. no device.build), you can set it with

set_device('cuda_standalone', with_output=False)

If you use build, you need to set it there:

device.build(with_output=False)

I can’t test it right now, let me know if it doesn’t work!

Hi @mstimberg , I have the following device function for multiple runs:

    brian2.set_device(input_param.device_name, directory=directory, build_on_run=False)
    brian2.device.build(run=False, directory=input_param.device_name+str(self.rank), with_output=False)
    brian2.device.run(run_args=arguments)

All the logging output are still there with the option: with_output=False

Ah, if you also have a separate run call, could you move the with_output argument there and see whether that suppresses the output?

1 Like

Hi @mstimberg . Yes, this one works. Thanks

1 Like

Oh, and @DavidKing2020 – the old chat should still be around here (read-only): https://matrix.to/#/#brian-team_brian2:gitter.im

1 Like