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

Radis on Colab with GPU #28

Open
erwanp opened this issue Oct 16, 2021 · 2 comments
Open

Radis on Colab with GPU #28

erwanp opened this issue Oct 16, 2021 · 2 comments

Comments

@erwanp
Copy link
Member

erwanp commented Oct 16, 2021

A first attempt to run RADIS on Google-colab with GPU (note that GPU must be enabled in Edit / Notebook settings)

https://colab.research.google.com/drive/1RnbAm_YIBZJW-7fEXp60oGFX8iAt_951#scrollTo=WRHD7xue_-yw

!pip install radis

Got radis 0.10.3

from radis import calc_spectrum
s = calc_spectrum(1900, 2300,         # cm-1
                  molecule='CO',
                  isotope='1,2,3',
                  pressure=1.01325,   # bar
                  Tgas=700,           # K
                  mole_fraction=0.1,
                  path_length=1,      # cm
                  databank='hitemp',  # or use 'hitemp'
                  verbose=False,
                  mode='gpu'
                  )
s.apply_slit(0.5, 'nm')       # simulate an experimental slit
s.plot('radiance')

Failed with the following :

RADIS configuration file created in /root/radis.json
Added HITEMP-CO database in /root/radis.json
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-3-428ebed103f5> in <module>()
      9                   databank='hitemp',  # or use 'hitemp'
     10                   verbose=False,
---> 11                   mode='gpu'
     12                   )
     13 s.apply_slit(0.5, 'nm')       # simulate an experimental slit

3 frames
/usr/local/lib/python3.7/dist-packages/radis/lbl/gpu.py in <module>()
     67 # TO-DO: read and compile CUDA code at install time, then pickle the cuda object
     68 cuda_fname = join(getProjectRoot(), "lbl", "gpu.cu")
---> 69 with open(cuda_fname, "rb") as f:
     70     cuda_code = f.read().decode()
     71 

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/radis/lbl/gpu.cu'
@erwanp erwanp changed the title Lab with GPU Radis on Colab with GPU Oct 16, 2021
@erwanp
Copy link
Member Author

erwanp commented Oct 16, 2021

@dcmvdbekerom this will be a good test for the GPU code too !

@dcmvdbekerom
Copy link
Member

At some point the file was renamed to "gpu.cpp" to allow for cpu/gpu hybrid code ('emulated GPU'). Replacing "gpu.cu" with "gpu.cpp" should do the trick, though the fact that it's not updated might be indicative that there are still some issues with merging..

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

No branches or pull requests

2 participants