Skip to content

improve logging of config & device_properties#810

Draft
rjodinchr wants to merge 2 commits intokpet:mainfrom
rjodinchr:pr/log
Draft

improve logging of config & device_properties#810
rjodinchr wants to merge 2 commits intokpet:mainfrom
rjodinchr:pr/log

Conversation

@rjodinchr
Copy link
Contributor

@rjodinchr rjodinchr commented Aug 27, 2025

$ CLVK_CONFIG_FILE=tests/config/conf_test.conf CLVK_CLSPV_NATIVE_BUILTINS="acos, asin" CLVK_DISABLED_IMAGE_FORMATS="{CL_RGB, CL_UNORM_SHORT_565},{CL_R, CL_SNORM_INT8}" CLVK_LOG=3 CLVK_LOG_GROUPS=cfg simple_test
[CLVK] parse_config_file: Parsing config file 'tests/config/conf_test.conf'
[CLVK] print_config:
[CLVK]   *cache_dir: 'testing'
[CLVK]   *clspv_native_builtins: 'acos, asin'
[CLVK]   *config_file: 'tests/config/conf_test.conf'
[CLVK]   *disabled_image_formats: '{CL_R, CL_SNORM_INT8}, {CL_RGB, CL_UNORM_SHORT_565}'
[CLVK]   *log: 3 (0x3)
[CLVK]   *log_groups: 'cfg'
[CLVK] cvk_device_properties:
[CLVK]   *clspv_native_builtins: 'acos, asin, ceil, copysign, fabs, fdim, floor, fmax, fmin, half_cos, half_exp, half_exp10, half_exp2, half_rsqrt, half_sin, half_sqrt, half_tan, isequal, isfinite, isgreater, isgreaterequal, isinf, isless, islessequal, islessgreater, isnan, isnormal, isnotequal, isordered, isunordered, mad, rint, round, rsqrt, signbit, sqrt, trunc'
[CLVK]   *clspv_options: '-hack-convert-to-float'
[CLVK]   *vendor: 'Mesa'
Platform: clvk
Device: llvmpipe (LLVM 19.1.7, 256 bits)
Buffer content verified, test passed.

refactor device_properties to use config.def as the reference

  • remove sections in device.{cpp,hpp} that were hard to maintain
  • improve printing of relevant device_propeties
  • support more data type in config.def for better parsing/printing

always print warn/error/fatal, whatever the group


move CLVK_CONFIG_FILE to config

run parse_env before parse_config_file to be able to set
CLVK_CONFIG_FILE with 'log' set inside it and still have it set before
'init_logging' which happens between 'init_early_config' and
'init_config'.

Make sure not to override env value with config file ones

@rjodinchr rjodinchr changed the title config: print full configuration in log improve logging of config & device_properties Aug 28, 2025
@rjodinchr rjodinchr force-pushed the pr/log branch 3 times, most recently from 35f722f to 620c188 Compare August 28, 2025 09:08
@rjodinchr
Copy link
Contributor Author

$ CLVK_CONFIG_FILE=tests/config/conf_test.conf CLVK_CLSPV_NATIVE_BUILTINS="acos, asin" CLVK_DISABLED_IMAGE_FORMATS="{CL_RGB, CL_UNORM_SHORT_565},{CL_R, CL_SNORM_INT8}" CLVK_LOG=4 CLVK_LOG_GROUPS=cfg simple_test
[CLVK] parse_env: 'CLVK_CLSPV_NATIVE_BUILTINS' = 'acos, asin'
[CLVK] parse_env: 'CLVK_DISABLED_IMAGE_FORMATS' = '{CL_RGB, CL_UNORM_SHORT_565},{CL_R, CL_SNORM_INT8}'
[CLVK] parse_config_file: Parsing config file 'tests/config/conf_test.conf'
[CLVK] read_config_file: 'cache_dir' = 'testing'
[CLVK] print_config:
[CLVK]   bgra_format_not_supported_for_image1d_buffer: false
[CLVK]   build_in_separate_thread: false
[CLVK]   *cache_dir: 'testing'
[CLVK]   clspv_library_builtins:
[CLVK]   *clspv_native_builtins: 'acos, asin'
[CLVK]   clspv_options: ''
[CLVK]   clspv_path: '/usr/local/google/home/rjodin/git/clvk/build/clspv'
[CLVK]   compiler_temp_dir: ''
[CLVK]   *config_file: 'tests/config/conf_test.conf'
[CLVK]   destroy_global_state: true
[CLVK]   device_extensions:
[CLVK]   device_extensions_masked:
[CLVK]   *disabled_image_formats: '{CL_R, CL_SNORM_INT8}, {CL_RGB, CL_UNORM_SHORT_565}'
[CLVK]   dynamic_batches: false
[CLVK]   early_flush_enabled: true
[CLVK]   enabled_image_formats:
[CLVK]   enqueue_command_retry_sleep_us: 4294967295 (0xffffffff)
[CLVK]   force_check_capabilities_error: false
[CLVK]   force_descriptor_set_allocation_failure: false
[CLVK]   force_subgroup_size: 0 (0x0)
[CLVK]   global_mem_cache_size: 0 (0x0)
[CLVK]   ignore_out_of_order_execution: false
[CLVK]   init_image_at_creation: false
[CLVK]   keep_temporaries: false
[CLVK]   *log: 4 (0x4)
[CLVK]   log_colour: false
[CLVK]   log_dest: ''
[CLVK]   *log_groups: 'cfg'
[CLVK]   log_groups_only: false
[CLVK]   max_cmd_batch_size: 10000 (0x2710)
[CLVK]   max_cmd_group_size: 4294967295 (0xffffffff)
[CLVK]   max_compute_units: 1 (0x1)
[CLVK]   max_entry_points_instances: 2048 (0x800)
[CLVK]   max_first_cmd_batch_size: 10000 (0x2710)
[CLVK]   max_first_cmd_group_size: 4294967295 (0xffffffff)
[CLVK]   max_mem_alloc_size_mb: 1024 (0x400)
[CLVK]   non_uniform_decoration_broken: false
[CLVK]   opencl_version: 12582912 (0xc00000)
[CLVK]   percentage_of_available_memory_reported: 100 (0x64)
[CLVK]   physical_addressing: false
[CLVK]   preferred_subgroup_size: 0 (0x0)
[CLVK]   printf_buffer_size: 1048576 (0x100000)
[CLVK]   queue_global_priority: 1 (0x1)
[CLVK]   queue_profiling_use_timestamp_queries: false
[CLVK]   skip_spirv_capability_check: false
[CLVK]   spirv_arch: 'spir'
[CLVK]   spirv_validation: 2 (0x2)
[CLVK]   supports_filter_linear: true
[CLVK]   validation_layers: false
[CLVK]   vendor: 'Unknown vendor'
[CLVK] cvk_device_properties:
[CLVK]   *clspv_native_builtins: 'acos, asin, ceil, copysign, fabs, fdim, floor, fmax, fmin, half_cos, half_exp, half_exp10, half_exp2, half_rsqrt, half_sin, half_sqrt, half_tan, isequal, isfinite, isgreater, isgreaterequal, isinf, isless, islessequal, islessgreater, isnan, isnormal, isnotequal, isordered, isunordered, mad, rint, round, rsqrt, signbit, sqrt, trunc'
[CLVK]   *clspv_options: '-hack-convert-to-float'
[CLVK]   *vendor: 'Mesa'
[CLVK]   preferred_subgroup_size: 0 (0x0)
[CLVK]   max_compute_units: 1 (0x1)
[CLVK]   global_mem_cache_size: 0 (0x0)
[CLVK]   non_uniform_decoration_broken: false
[CLVK]   bgra_format_not_supported_for_image1d_buffer: false
[CLVK]   disabled_image_formats: '{CL_RGB, CL_UNORM_SHORT_565}, {CL_R, CL_SNORM_INT8}'
[CLVK]   enabled_image_formats:
[CLVK]   max_cmd_batch_size: 10000 (0x2710)
[CLVK]   max_first_cmd_batch_size: 10000 (0x2710)
[CLVK]   max_cmd_group_size: 4294967295 (0xffffffff)
[CLVK]   max_first_cmd_group_size: 4294967295 (0xffffffff)
Platform: clvk
Device: llvmpipe (LLVM 19.1.7, 256 bits)
Buffer content verified, test passed.

@rjodinchr rjodinchr force-pushed the pr/log branch 2 times, most recently from 9bd368c to bfb5aa0 Compare September 9, 2025 04:38
@rjodinchr rjodinchr marked this pull request as draft September 9, 2025 04:39
@rjodinchr
Copy link
Contributor Author

In fact, the 4 commits cannot be reviewed in parallel, they all depend on the previous one.
I have created #815 with the first commit.
I've marked this one as a draft. Until we get to the last one?
The idea being to keep the end goal visible.

- remove sections in device.{cpp,hpp} that were hard to maintain
- improve printing of relevant device_propeties
- support more data type in config.def for better parsing/printing

to be rebased
run parse_env before parse_config_file to be able to set
CLVK_CONFIG_FILE with 'log' set inside it and still have it set before
'init_logging' which happen between 'init_early_config' and
'init_config'.

Make sure not to override env value with config file ones
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