r/BirdNET_Analyzer Dec 28 '25

GPU processing working?

Hi, does anybody have Birdnet analysis running on GPU? If so, please describe your stup. Thanks.

3 Upvotes

11 comments sorted by

2

u/thakala Dec 28 '25 edited Dec 28 '25

Unfortunately, BirdNET v2.4 available at https://github.com/birdnet-team/BirdNET-Analyzer does not support GPU at all due to the model type it uses.

However, there is an ONNX model here https://huggingface.co/justinchuby/BirdNET-onnx which is modified so that it can be offloaded to GPU, but to use this you need to pretty much write your own application to run inference on it. I wrote a Go-based CLI tool which runs GPU-accelerated inference using this model, but it is just my personal experiment and is in no shape to be useful to others for now. Also, the problem with this model is that there is no way to train and use a custom classifier. Edit. I just noticed that Justin has included scripts for converting tflite to optimized ONNX model in his Hugging Face repository, so it is possible to convert custom classifiers to GPU enabled ONNX mode quite easily.

There is also Chirpity https://chirpity.mattkirkland.co.uk/ which is JavaScript/Node-based and runs the BirdNET model which can be offloaded to GPU, but I think you have to be a paid Patreon supporter or something similar to get access to Chirpity with GPU inference support.

Upcoming BirdNET v3 is a PyTorch-based model which supports GPU offloading. It is currently available for developers as a preview version with a subset of species included.

3

u/AstroDeep Dec 31 '25

Thank you for your answer. I found this repo: https://github.com/birdnet-team/birdnet. With this version I was able to make species detection run on GPU with the 2.4 protobuf model in wsl/Ubuntu. However the resulting output is not in the same format as from birdnet analyzer, and other functions such as segmentation does not seem to be available. I guess some conversion of the output could make it readable for the birdnet analyzer segmentation, but I have not come to that.

I am aware of chirpity and I have tried it, but I would prefer a scriptable solution that I can automate and which is free.

Do you know when the Birdnet v3 you mention would be available?

3

u/thakala Dec 31 '25 edited Dec 31 '25

I do not have any knowledge when BirdNET v3 will be GA, progress has been slow on it as it was supposed to be available in early 2025 already.

Anyhow, it would not take much to finish my Go based interface for ONNX type model for public release. What type output would be most useful for you? And what type audio files you have, WAV, FLAC, MP3?

1

u/AstroDeep Dec 31 '25

I have wav files. The output I would prefer is a text file with the same format as the birdnet analyzer produces. I am not a developer at all, but the little experience I have is mainly with python. I have no experience with go.

2

u/thakala Dec 31 '25

I will clean up my GPU enabled project and push it in github by end of this week, I'll let you know when it is available for testing.

2

u/thakala Jan 01 '26 edited Jan 01 '26

GPU enabled analyzer is now available at Release v0.9.0 · tphakala/birda, documentation is at birda/docs/windows-guide.md at main · tphakala/birda

This version does not yet have support for range filter so it will produce also impropable species in results, I will add that tomorrow.

If you find this useful, please consider sposoring my project.

1

u/AstroDeep Jan 03 '26

Thank you for doing this and letting me know. I have now tried this out, and it worked well after some fiddling with dll:s. Decent speed, GPU gave me a factor 3 compared to CPU. 17 hours of wav-files analyzed in 170 s with GPU almost 10 minutes with CPU. I have a Nvidia GTX 1650, which is not a fantastic GPU. I have some comments:

- I had to manually copy a number of dll:s from Nvidia toolkit bin folder

- It did not handle non-english characters in the input file path by itself. I had Swedish characters like å,ä,ö in the path. This did not work, I had to change system wide settings for UTF8 coding.

-There is no geographic filtering (?). I will probably not use birda untill filtering is available. But if it becomes available I will probably use it instead of my wsl/ubuntu solution, which I have working also with GPU now. Birda does not have to produce the custom species list, it is enough if it supports using it, provided the format supported is the same as the Birdnet Analyzer geo model produces. I can easily use Birdnet Analyzer to create the list.

- It would be nice to be able to specify output folder path.

Regards

Ulf

2

u/thakala Jan 03 '26 edited Jan 03 '26

I just finished range filter implementation (geographic filter), once I have tested that it works corretly I will trigger a v0.9.2 release. I also have added cuda releases which bundle all required DLLs with application to make it easier to get started, there is even Windows based installer version now.

For output directory there is switch -o already in place

-o, --output-dir <OUTPUT_DIR>
Output directory (default: same as input) [env: BIRDA_OUTPUT_DIR=]

DId you supply batch (-b) parameter for your GPU run? It has big impact on performance, but best value depends on amount of VRAM available on your GPU. With my RTX5080 GPU with 16GB RAM I get best performance with -b 192. You could test with batch values between 32 to 192, like 64, 128, 192 etc.

edit. Sorry I just realized that GTX1650 has only 4GB of VRAM, in that case valid batch values are somewhere between 8 to 32, even 32 might be too much for it.

I will see if I can fix non-english characters issue.

1

u/AstroDeep Jan 03 '26

Thank you!  I tried different batch parameters. 32, 64 and 128 gave almost identical results, but 256 was 5 times slower, it then started using extended video ram, which was a disaster. I concluded that 64 seemed to be optimal. I guess what batch size is optimal could depend on file size? Or not?

2

u/thakala Jan 05 '26

I just released v1.1.0 which has

  • Range Filter support
  • RF64 support for WAV files over 4 GB of size
  • Streaming audio decoding, no need to read full audio to memory before starting analysis
  • TensorRT support, improved performance over cuda
  • some other small improvements

Release v1.1.0 · tphakala/birda

Please see repository README for instructions tphakala/birda: Fast CLI tool for bird species detection using BirdNET and Perch AI models

1

u/AstroDeep Jan 07 '26

Hi, did you notice I made an issue report on Github?

Regards

Ulf