Skip to content

Conversation

@bratpiorka
Copy link
Contributor

Log sycl-ls adapter errors in verbose mode. Additionally, inform the user about verbose mode when no platforms are found.

@bratpiorka bratpiorka marked this pull request as ready for review March 26, 2025 09:52
@bratpiorka bratpiorka requested a review from a team as a code owner March 26, 2025 09:52
@npmiller
Copy link
Contributor

Looks great! Although I think we should also still downgrade the message from error to info, since there's plenty of cases where it's not an error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullptr is preferred over NULL in C++.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be orig_ur_log_loader_var_str = std::getenv("UR_LOG_LOADER")?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orig_ur_log_loader_var = std::getenv("UR_LOG_LOADER") (the char* not the string)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we setting this unconditionally? Someone might want to run UR_LOG_LOADER="level:error;output:file,some_file" sycl-ls --verbose in order to capture the output into a file rather than stderr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I see - what do you suggest in this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could parse the variable if it's already set by the user, and:

  1. set level to error if not already set to a lower level (e.g. user sets level:info)
  2. set output to stderr if not set already and level is error (I wouldn't redirect info and debug to stderr)

Otherwise, if the variable is unset, then set "level:error;output:stderr".

Pseudocode:

if var_is_set:

  if not level_is_set:
    level = error

  if level >= error and not output_is_set:
    output = stderr

else:
  level = error
  output = stderr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if it is set at all then we should just ignore it; presumably the user knows what they are doing. But Rafbeils' solution is fine by me as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafbiels , I think parsing the log variable might be overly complicated. I agree with @RossBrunton that if the user is already aware of the UR_LOG_LOADER env var and knows how to set it, no further help is needed.
I have updated my PR so that if the UR_LOG_LOADER evn var is set, we do not modify it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, I'm also happy with that 👍

@bratpiorka bratpiorka force-pushed the review/rrudnick/sycl_ls_verbose_err branch from d1aca1e to f5b5818 Compare March 26, 2025 11:26
@bratpiorka bratpiorka requested a review from a team as a code owner March 26, 2025 11:26
@bratpiorka bratpiorka force-pushed the review/rrudnick/sycl_ls_verbose_err branch from f5b5818 to 6b380ee Compare March 26, 2025 14:46
Copy link
Contributor

@HPS-1 HPS-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bratpiorka
Copy link
Contributor Author

@intel/llvm-gatekeepers please merge

@bratpiorka
Copy link
Contributor Author

@llvm-reviewers-runtime please review

@bratpiorka bratpiorka force-pushed the review/rrudnick/sycl_ls_verbose_err branch from 6b380ee to b8a6485 Compare April 1, 2025 14:19
@bratpiorka
Copy link
Contributor Author

rebased,
@intel/llvm-gatekeepers please merge

@aelovikov-intel
Copy link
Contributor

rebased, @intel/llvm-gatekeepers please merge

CI isn't ready yet. Please ping us once it is.

@bratpiorka bratpiorka force-pushed the review/rrudnick/sycl_ls_verbose_err branch from b8a6485 to e16a754 Compare April 2, 2025 07:35
@bratpiorka
Copy link
Contributor Author

I see some errors not related to my changes - are the machines working correctly?

default_selector() : No device of requested type available.
accelerator_selector() : No device of requested type available.
cpu_selector() : No device of requested type available.
gpu_selector() : No device of requested type available.
custom_selector(gpu) : No device of requested type available.
custom_selector(cpu) : No device of requested type available.
custom_selector(acc) : No device of requested type available.

Error: The action has timed out.

@intel/llvm-gatekeepers please merge

@sarnex
Copy link
Contributor

sarnex commented Apr 2, 2025

im investigating

@sarnex sarnex merged commit 79a185a into intel:sycl Apr 2, 2025
89 of 104 checks passed
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.

8 participants