Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaphandre Windows Installation #247

Closed
joegharbi opened this issue Dec 19, 2022 · 9 comments
Closed

Scaphandre Windows Installation #247

joegharbi opened this issue Dec 19, 2022 · 9 comments

Comments

@joegharbi
Copy link

joegharbi commented Dec 19, 2022

Hello everyone,
I would be grateful to all of you if you could help me with the issue I am facing.
I have been trying to compile Scaphandre using Windows 11 for weeks now. I have tried all possible solutions.
Let me tell you my configuration, what I have done so far, and the issue I am facing.

  • I have installed windows-rapl-driver and running driverquery /v | grep -i scaph result in this:

Screenshot 2022-12-19 111904

  • I have installed two toolchains versions of rust the MSVC and GNU, I have solved all issues I was facing regarding the Openssl-dev... but ending up with the same issue libc::pid_t .. mainly related to libc and 2 errors for os::unix.
  • it really doesn't matter what configuration I use ( GNU using msys2 or MSVC using Microsoft build tools and vcpkg) results always in this Some errors have detailed explanations: E0412, E0425, E0432, E0433, E0599. For more information about an error, try `rustc --explain E0412`. error: could not compile `procfs` due to 24 previous errors warning: build failed, waiting for other jobs to finish... .
  • I did always make sure to clean my system while switching from GNU to MSVC.
  • As far as I understood the libc is used with Unix-like environments. Is there a way to overcome this issue?
  • My purpose for using the Scaphandre tool is to be able to measure Erlang functions using Windows.

I am open to trying all solutions and propositions.
Thank you all

@joegharbi joegharbi changed the title Windows Install Scaphandre Windows Installation Dec 19, 2022
@tormath1
Copy link

Hello, did you have a look to the dev branch which holds steps to compile on Windows?

test_windows_x86_64:
name: Test on Windows x86_64 (Virtual machine worker)
runs-on: "windows-2019"
needs: fmt_and_clippy_windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rustup
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install rustup.install --ignore-checksums
- name: Install Rust toolchain
run: |
rustup toolchain install stable-x86_64-pc-windows-msvc
- name: Build (debug mode)
run: |
cargo build --no-default-features --features "prometheus json riemann"

I think it can help to reproduce these steps.

@joegharbi
Copy link
Author

Thank you so much.

  • Reproducing these steps helped with building scaphandre locally.
  • However, I am not able to use it since the windows-rapl-driver seems to not be started yet.
    image
  • As I mentioned earlier it seems that the driver is there but won't be able to start it with net start ScaphandreDr
  • I will try to investigate more about the driver issue but it would be great if you can help me if you already have a solution for that.

Thank you so much.

@tormath1
Copy link

@joegharbi happy that you've successfully built Scaphandre locally. For the second issue, I quickly checked - it seems to come from this code:
https://github.com/hubblo-org/windows-rapl-driver/blob/ebe845447fe42e0bbcc65f4c4a6434629cce9b70/userland/Agent/RAPLAgent.cpp#L49-L56

Three things:

@joegharbi
Copy link
Author

joegharbi commented Dec 21, 2022

@tormath1 Thank you so much for the quick reply.
Answering to the three things: Yes I am in test mode with windows 11 and using Administrator cmd.

I did some investigations I have these findings if you can confirm which way to proceed:

  • I did the build with MinGW. Do you think reinstalling it using CPUID could help? Since when I first tried to install it with MinGW I got a header error wdmguid.h: No such file or directory. I solved it adding -I + path-to-wdmguid.h.

  • When I try to look for the driver I do have this
    image which is not in the usual system32/drivers folder ( It might be not the actual issue) and by default rebooting after the installation should start the service automatically which was not my case.

  • Even after reinstalling it in the system32/drivers folder I still can't start it (I even disabled Windows signature enforcement and restarted my computer).
    image

  • I have strong doubts about which ScaphandreDrv.sys file to have with DriverLoader.exe since there are many in the repository, So I might be using the wrong one?

image

Thank you so much for your help

@joegharbi
Copy link
Author

I was able to run the driver using windows 11.

  • In test mode, I used windows-rapl-driver/kernelland/ScaphandreDrv/x64/Release/ScaphandreDrv/ScaphandreDrv.sys to build the DriverLoader.cpp .

This solved the issue.
I hope this can help future users run scaphandre under windows.

@demeringo
Copy link
Contributor

Nice to see it working 👍
Thank you @joegharbi for the feedback and documenting the issue.

@joegharbi
Copy link
Author

Thank you so much for your help.

@bpetit
Copy link
Contributor

bpetit commented Jan 26, 2023

Hi @joegharbi

Happy you could make it. Thanks for sharing this walkthrough, it will help us improve and simplify the procedure.

cc @vico63 this thread shows us what to improve :)

@Vic063
Copy link

Vic063 commented Jan 26, 2023

I'll look into that 🙂
Thank you for your feedback.

@bpetit bpetit added this to General Jun 19, 2024
@bpetit bpetit moved this to Previous releases in General Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Previous releases
Development

No branches or pull requests

5 participants