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

Does not start on Windows #8

Closed
kelteseth opened this issue Sep 6, 2023 · 5 comments
Closed

Does not start on Windows #8

kelteseth opened this issue Sep 6, 2023 · 5 comments

Comments

@kelteseth
Copy link

Nothing happens except for the two prints. Also, what license does this project have? Cheers!

# python 3.11
python -m pip install torch numpy
# downloaded sam_vit_b_01ec64.pth  and put it in checkpoints
python convert-pth-to-ggml.py checkpoints/sam_vit_b_01ec64.pth . 1
mkdir build && cd build 
# PS C:\vcpkg> .\vcpkg.exe install sdl2:x64-windows
cmake .. -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake"
cmake --build . --config Release
# contains sam.exe and SDL2.dll
cd .\bin\Release\
 C:\Code\cpp\sam.cpp\build\bin\Release> .\sam.exe -t 16 -i ../../../img.jpg -m ../../../checkpoints/ggml-model-f16.bin
 
SDL_main: seed = 1693989358
SDL_main: loaded image '../../../img.jpg' (680 x 453)
PS C:\Code\cpp\sam.cpp\build\bin\Release>
@SpaceCowboy850
Copy link

SpaceCowboy850 commented Sep 7, 2023

Works for me.

You must get SDL2 DEV package for VC to work in Windows, then point CMAKE to where the sdl2-config.cmake resides. After that everything worked for me.

cmake -DSDL2_DIR=E:\SDL2-devel-2.28.3-VC\SDL2-2.28.3\cmake ..

https://github.com/libsdl-org/SDL/releases/tag/release-2.28.3

Finally, you'll need to copy the SDL2.dll to be next to the sam.exe, otherwise, you'll get an error about a missing dll when you run.

@spacewalk01
Copy link

I've integrated it to visual studio:
https://github.com/spacewalk01/sam-cpp-vs

@FSSRepo
Copy link

FSSRepo commented Sep 12, 2023

Nothing happens except for the two prints.

I resolved that inserting ggml_time_init(); in the beginning of the function std::shared_ptr<sam_state> sam_load_model(const sam_params & params) in the file sam.cpp

Like this:

std::shared_ptr<sam_state> sam_load_model(const sam_params & params) {
    ggml_time_init(); // add this and runs normal
    const int64_t t_start_ms = ggml_time_ms();

@YavorGIvanov
Copy link
Owner

This was already added last week in the master branch
39aa3eb

@YavorGIvanov
Copy link
Owner

Closing for now. If any other similar problem happens on Windows, please open a new issue.

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

No branches or pull requests

5 participants