# Error: unable to load nvrtc

**URL:** <https://pyfr.discourse.group/t/error-unable-to-load-nvrtc/917>\
**Category:** Errors\
**Tags:** cuda\
**Created:** [11 September 2023 07:06 UTC](https://pyfr.discourse.group/t/error-unable-to-load-nvrtc/917 "2023-09-11T07:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubens](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rubens](https://pyfr.discourse.group/u/rubens)\
**Post date:** [11 September 2023 07:06 UTC](https://pyfr.discourse.group/t/error-unable-to-load-nvrtc/917/1 "2023-09-11T07:06:35Z")

</div>

Good morning everyone. I´m having this errors while trying to run the test cases (in particular the 2d-cylinder) from my terminal:

```auto
File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 58, in load_library
    return ctypes.CDLL(lname)
  File "/apps/Arch/software/Python/3.9.5-GCCcore-10.3.0/lib/python3.9/ctypes/ __init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libnvrtc.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/cephyr/users/rubensd/Alvis/my_Rpython/bin/pyfr", line 8, in <module>
    sys.exit(main())
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/ __main__.py", line 118, in main
    args.process(args)
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/ __main__.py", line 251, in process_run
    _process_common(
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/ __main__.py", line 230, in _process_common
    backend = get_backend(args.backend, cfg)
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/backends/ __init__.py", line 12, in get_backend
    return subclass_where(BaseBackend, name=name.lower())(cfg)
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/backends/cuda/base.py", line 21, in __init__
    self.nvrtc = NVRTC()
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/backends/cuda/compiler.py", line 54, in __init__
    self.lib = NVRTCWrappers()
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 15, in __init__
    self._lib = lib = load_library(self._libname)
  File "/cephyr/users/rubensd/Alvis/my_Rpython/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 67, in load_library
    raise OSError(f'Unable to load {name}')
OSError: Unable to load nvrtc

```

I think that the main errors are:  
“OSError: libnvrtc.so: cannot open shared object file: No such file or directory”  
and:  
“OSError: Unable to load nvrtc”

I´m new to python, pyfr and linux, so I´m really at the starting point and I´m sorry if I´m missing something easy. I hope that someone could help me.  
Kind regards,  
Rubens.

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [11 September 2023 08:19 UTC](https://pyfr.discourse.group/t/error-unable-to-load-nvrtc/917/2 "2023-09-11T08:19:45Z")

</div>

The first thing to do is update to Python\>=3.10, then ensure that CUDA is in the `LD_LIBRARY_PATH` in the environment you are running in.

---

<div class="post-metadata">

**Author:** ![rubens](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rubens](https://pyfr.discourse.group/u/rubens)\
**Post date:** [11 September 2023 12:10 UTC](https://pyfr.discourse.group/t/error-unable-to-load-nvrtc/917/3 "2023-09-11T12:10:47Z")

</div>

Thank you very much, now it is working! In the end it was a very simple thing to be fixed but it was taking ages for me.  
Kind regards,  
Rubens
