cmgcds / fastvpinns

FastVPINNs - A tensor-driven acceleration of VPINNs for complex geometries
https://cmgcds.github.io/fastvpinns/
MIT License
16 stars 10 forks source link

Installation and reproducibility #15

Closed pescap closed 1 month ago

pescap commented 1 month ago

Dear all, I successfully installed the library from the DeepXde Docker image, which includes TensorFlow 2.9.2.

For your information, I had to further install the following libraries:

apt-get install libgl1-mesa-glx
apt-get install libglu1
apt-get install libxcursor-dev
apt-get install libxft2
apt-get install libxinerama

Is it a known behavior?

It could be beneficial to build a dedicated image for fastvpinns, for reproducibility purposes. I could help you with this.

Finally, do you recommend any version of TensorFlow? Best,

thivinanandh commented 1 month ago

Hi @pescap ,

Thanks for raising a request for the enhancement.

Additional requirements :

Yes as you have mentioned libgl1-mesa-glx library will be needed as additional installation, which was mentioned in the installation section of the documentation Link. However, in our tests we did not find the need to install other libraries, which were mentioned above. If you could provide us an example where libgl1-mesa-glx is not sufficient, then we can go ahead and add the additional libraries to the documentation page.

Tensorflow Version

Currently the code is tested upto tensorflow version 2.13 (as observed from the requirements.txt file). . Depending on your OS, cuDNN, and CUDA version, any version of TensorFlow from 2.9 to 2.13 can be used.

Dedicated Docker Image

As suggested, I have created a new docker image at the url FastPINNs-Docker Link,You can pull the image using the command:

docker pull thivinanandh/fastvpinns:latest.

The docker image will have the welcome message, which displays the cuda driver, gpu and tensorflow version

image

The Docker image is built on Ubuntu 20.04, with CUDA version 11.2 and cuDNN version 8.1, and it includes TensorFlow version 2.11 (since tensorflow 2.11 is compiled with cuDNN 8.1). The additional documentation on how to use the docker image is available at the FastVPINNs-Docker Documentation Page

Please let me know if you need any additional information regarding the same

pescap commented 1 month ago

Dear all, great!

When I run the container

docker run --gpus all -it --rm -v ~/fastvpinns:/fastvpinns thivinanandh/fastvpinns:latest

I get:


Traceback (most recent call last):
  File "/docker_initialise.py", line 85, in <module>
    main()
  File "/docker_initialise.py", line 50, in main
    version = get_version_from_toml()
  File "/docker_initialise.py", line 6, in get_version_from_toml
    with open("pyproject.toml", "r") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'pyproject.toml'
thivinanandh commented 1 month ago

Hi @pescap ,

Bug: [Errno 2] No such file or directory: 'pyproject.toml'

Root Cause : It seems that in the Dockerfile i have used a git clone command to pull the codes from the github repository to get the updated codes and files. However , during my build, docker seems to have used a cached version of the git clone command and the recent changes made to the codes were not reflected in the local build.

Fix: The issue is fixed now, by running the build using --no-cache flag .

Could you kindly try once again to see if the issue persists or not.

pescap commented 1 month ago

Hi @pescap ,

Bug: [Errno 2] No such file or directory: 'pyproject.toml'

Root Cause : It seems that in the Dockerfile i have used a git clone command to pull the codes from the github repository to get the updated codes and files. However , during my build, docker seems to have used a cached version of the git clone command and the recent changes made to the codes were not reflected in the local build.

Fix: The issue is fixed now, by running the build using --no-cache flag .

Could you kindly try once again to see if the issue persists or not.

Hi, has the Docker image been updated here? (with docker push)

thivinanandh commented 1 month ago

@pescap , yes it has been updated with docker push. The Current image on dockerhub is the updated image

Thanks

pescap commented 1 month ago

Hi, I am still having the same error.

thivinanandh commented 1 month ago

Hi @pescap ,

Sorry, I was attending a conference past week thats why i was not able to reply back in time. Please find below the fix for the issue reported with docker.

Issue

File not found while trying to launch the docker terminal

[Errno 2] No such file or directory: 'pyproject.toml'

Root Cause

It seems there was no issue with the docker build, rather the issue was with the usage of -v flag which we used to mount an external volume. When we use -v ~/fastvpinns:/fastvpinns, we were mounting an empty directory from a host named ~/fastvpinns to the actual directory within the docker container /fastvpinns, which contains the code base. So when this command is executed, the empty directory overwrites the core directory /fastvpinns within our docker environment causing the docker build to look for a file, which has been deleted now due to the mounting.

Fix The fix is to mount an external directory from host into a new directory such as /fastvpinns/output within the docker environment, so that it does not overwrite the existing codes. Updated command for this is as follows,

docker run --gpus all -it --rm -v ~/fastvpinns_docker_output:/fastvpinns/output thivinanandh/fastvpinns:latest

Additional Update

The explanation for the same is now added to the docker documentation page of FastVPINNs and the running instructions are updated accordingly. Docker Documentation - FastVPINNs

please pull the new version of the docker image for testing

thivinanandh commented 1 month ago

@pescap , let me know if this fixes the issue, so that i can close this issue

Please let me know if you need any additional information regarding the same.

pescap commented 1 month ago

Fixed, thank you!