Unstable installation of GROMACS with CUDA toolkit

Hi,
I have been able to compile GROMACS in my WSL Ubuntu with the CUDA toolkit. If I then perform a simulation on a Ubuntu terminal prompt, I will be able to use gmx commands and perform simulations as normal. However, after a few hours, if I open a new terminal window and use any gmx command, I will get the error:

~$ gmx pdb2gmx -f bb2_clean.pdb -o bb2_processed.gro -water spce
Command 'gmx' not found, but can be installed with:
sudo apt install gromacs

If I delete the build folder in my gromacs-2024 and re-compile again with the CUDA toolkit, it will work again. Then again, after a few hours, when I open a new terminal window, I get the same error as above. It is not very practical to be re-compilling GROMACS every time I wanna perform a new simulation. I was wondering if someone is facing the same issue and how could one sort out this problem.

I am using:
Ubuntu 22.04 x86_64
CUDA toolkit 12.3 Update 2

This is because you will have to source GROMACS every time you open a new terminal. For example, let’s suppose GROMACS is installed in /home/rsp96/gromacs/install/, then you will have to source the file in the bin directory of the installation, that is, run a command like this:
$ source /home/rsp96/gromacs/install/bin/GMXRC.

If you followed the normal instructions, like those here, then the sourcing is what the last command is doing. This means that you are ‘adding’ the gmx command to your shell, and you can then use GROMACS. To avoid sourcing every time you open a new shell, you have to export the path where the binary is in your shell start up configuration file (e.g. .bashrc in your home).