drowe67 / freedv-gui

GUI Application for FreeDV – open source digital voice for HF radio
https://freedv.org/
GNU Lesser General Public License v2.1
210 stars 52 forks source link

Update README with Linux instructions for RADE. #758

Closed tmiw closed 3 weeks ago

tmiw commented 1 month ago

Due to high interest from Linux users, this PR adds some general documentation to the README for getting RADE to run on Linux.

barjac commented 1 month ago

This seems broken.

Following this step by step: Install PyTorch, TorchAudio and matplotlib Python packages. Some distros have packages for one or more of these, but you can also use pip in a Python virtual environment (recommended to ensure the latest versions):

OK that is fine, next:

$ cd freedv-gui (OK)
$ python3 -m venv rade-venv (OK)
$ ./rade-venv/bin/activate (permission denied as activate is not executable)
$ chmod +x ./rade-venv/bin/activate (OK)
$ ./rade-venv/bin/activate (OK)
(rade-venv) $ cd build_linux                  ####### needs explaining to cd #######
$ cd rade-venv (OK)
(rade-venv) $ pip3 install -r cmake/rade-requirements.txt (no such file/dir) ? maybe:
(rade-venv) $ pip3 install -r ../cmake/rade-requirements.txt  (OK since we are in rade-venv)

Build FreeDV to make sure the correct dependencies are linked in (namely numpy): 
(rade-venv) $ ./build_linux.sh                (No such file or dir) ? maybe:
(rade-venv) $ ../build_linux.sh
CMake Error: The source directory "/home/baz/freedv-gui-rade/freedv-gui/rade-venv" does not appear to contain CMakeLists.txt.

So what now?

Note. I know very little about python so tried to follow this doc step by step as any 'user' would do.

tmiw commented 1 month ago

Tweaked the README a bit. The intention is to basically do the following:

$ cd freedv-gui
$ python3 -m venv rade-venv
$ . ./rade-venv/bin/activate
(rade-venv) $ pip3 install -r cmake/rade-requirements.txt
(rade-venv) $ ./build_linux.sh
(rade-venv) $ cd build_linux
(rade-venv) $ ln -s `pwd`/rade_src/model19_check3 model19_check3
(rade-venv) $ PYTHONPATH=`pwd`/rade_src:$PYTHONPATH src/freedv

Suggestions on how to make that more clear are welcome.

barjac commented 1 month ago

Ah! You missed '.' . ./rade-venv/bin/activate I assumed activate was a script :0

Is there a way to avoid installing several GB of nvidia stuff if you don't have any nvidia hardware?

tmiw commented 1 month ago

Ah! You missed '.' . ./rade-venv/bin/activate I assumed activate was a script :0

Is there be a way to avoid installing several GB of nvidia stuff if you don't have any nvidia hardware?

It looks like you can use the following to do that:

pip3 install torch torchaudio --index-url https://download.pytorch.org/whl/cpu

(from https://pytorch.org/get-started/locally/)

Maybe there's a way to include --index-url in the requirements file? The difficulty being that including it doesn't seem to be needed for all platforms.

barjac commented 1 month ago

OK thanks - just looking at your update and I think maybe for clarity you should use $(pwd) rather than the backticks which may confuse some users. Similarly: source ./rade-venv/bin/activate

tmiw commented 1 month ago

OK thanks - just looking at your update and I think maybe for clarity you should use $(pwd) rather than the backticks which may confuse some users.

Done.

Tyrbiter commented 1 month ago

Might be sensible to show user as \ so that people realise it should be their own user ID.

barjac commented 1 month ago

It's working now, thanks Mooneer for your help! :) I had a long QSO on 80m with Matt (who reads the RSGB news) and we got down to about 2w at each end in a rather noisy band with hardly any errors noticeable! Utterly spectacular!!

Err... That should be $(pwd) not $PWD surely, as in bash command expansion, I don't have a PWD environment variable.

tmiw commented 1 month ago

Might be sensible to show user as so that people realise it should be their own user ID.

Done.

Err... That should be $(pwd) not $PWD surely, as in bash command expansion, I don't have a PWD environment variable.

Also done. Any other changes needed before this gets merged?

It's working now, thanks Mooneer for your help! :) I had a long QSO on 80m with Matt (who reads the RSGB news) and we got down to about 2w at each end in a rather noisy band with hardly any errors noticeable! Utterly spectacular!!

Good to hear!

ekk11 commented 3 weeks ago

The tweaked README worked for me: Ubuntu 24.04.1 LTS (noble).

tmiw commented 3 weeks ago

Thanks, I'll go ahead and merge since the instructions do seem to work for at least some Linux users. I'd recommend sharing tips over at the digitalvoice mailing list if you find that the instructions as written don't work for you.