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

Add GPU tag to readme #8

Merged
merged 1 commit into from
Dec 25, 2024
Merged

Add GPU tag to readme #8

merged 1 commit into from
Dec 25, 2024

Conversation

thespad
Copy link
Member

@thespad thespad commented Dec 20, 2024

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Benefits of this PR and context:

How Has This Been Tested?

Source / References:

@thespad thespad requested a review from a team December 20, 2024 21:07
@thespad thespad self-assigned this Dec 20, 2024
@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/piper/1.4.0-pkg-7a1e3f5e-dev-75543e5ede07fd8af42fc9f093b6d4efdeff4fc8-pr-8/index.html
https://ci-tests.linuxserver.io/lspipepr/piper/1.4.0-pkg-7a1e3f5e-dev-75543e5ede07fd8af42fc9f093b6d4efdeff4fc8-pr-8/shellcheck-result.xml

Tag Passed
amd64-1.4.0-pkg-7a1e3f5e-dev-75543e5ede07fd8af42fc9f093b6d4efdeff4fc8-pr-8
arm64v8-1.4.0-pkg-7a1e3f5e-dev-75543e5ede07fd8af42fc9f093b6d4efdeff4fc8-pr-8

@Roxedus Roxedus merged commit 9d5cc91 into main Dec 25, 2024
6 checks passed
@Roxedus Roxedus deleted the main-gpu-readme branch December 25, 2024 02:02
@aptalca aptalca mentioned this pull request Dec 29, 2024
1 task
@roryeckel
Copy link

roryeckel commented Jan 6, 2025

I tested the following compose service on my server:

piper:
        image: lscr.io/linuxserver/piper:gpu
        container_name: piper
        environment:
        - PUID=1000
        - PGID=1000
        - TZ=America/Chicago
        - PIPER_VOICE=en_US-hfc_female-medium
        - PIPER_LENGTH=1.0
        - PIPER_NOISE=0.667
        - PIPER_NOISEW=0.333
        - PIPER_SPEAKER=0
        - PIPER_PROCS=1
        volumes:
        - ./piper:/config
        ports:
            - 10200:10200
        restart: unless-stopped
        deploy:
            resources:
                reservations:
                    devices:
                        - driver: nvidia
                          capabilities: [gpu]
        memswap_limit: 0g
        runtime: nvidia

It functions, but I noticed immediately that it was running on CPU instead of GPU like it's supposed to. Note that I am running a similar stack from LinuxServer.io for faster-whisper which does use the GPU correctly.

After investigating, I found that piper is expecting "--use-cuda", NOT "--cuda" like these changes propose. After fixing that, I get an error:


future: <Task finished name='Task-9' coro=<AsyncEventHandler.run() done, defined at /lsiopy/lib/python3.12/site-packages/wyoming/server.py:28> exception=FileNotFoundError(2, 'No such file or directory')>

Traceback (most recent call last):

  File "/lsiopy/lib/python3.12/site-packages/wyoming/server.py", line 35, in run

    if not (await self.handle_event(event)):

            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/lsiopy/lib/python3.12/site-packages/wyoming_piper/handler.py", line 99, in handle_event

    wav_file: wave.Wave_read = wave.open(output_path, "rb")

                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/lib/python3.12/wave.py", line 649, in open

    return Wave_read(f)

           ^^^^^^^^^^^^

  File "/usr/lib/python3.12/wave.py", line 282, in __init__

    f = builtins.open(f, 'rb')

        ^^^^^^^^^^^^^^^^^^^^^^

FileNotFoundError: [Errno 2] No such file or directory: ''

And after further debugging, it appears the empty string comes from piper throwing a segmentation fault upon starting. Not sure how to continue debugging from here, but it looks like GPU is not quite ready to work with this container

Source: https://github.com/rhasspy/piper/blob/c0670df63daf07070c9be36b5c4bed270ad72383/src/cpp/main.cpp#L441

@thespad
Copy link
Member Author

thespad commented Jan 6, 2025

Unfortunately the piper binary silently ignores invalid CLI args, which makes testing it reliably extremely challenging.

@thespad
Copy link
Member Author

thespad commented Jan 6, 2025

Honestly the whole piper project seems to be kind of abandoned. No releases since 2023, few commits since then, issues and PRs largely ignored, readme doesn't even list the correct args for CUDA use. All my tests at the moment are resulting in segfaults but I'll see if I can make any progress.

@thespad
Copy link
Member Author

thespad commented Jan 6, 2025

It's not our image as it also segfaults in the nvidia pytorch container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants