NVIDIA / TensorRT

NVIDIA® TensorRT™ is an SDK for high-performance deep learning inference on NVIDIA GPUs. This repository contains the open source components of TensorRT.
https://developer.nvidia.com/tensorrt
Apache License 2.0
10.8k stars 2.13k forks source link

FileNotFoundError: Could not find: nvinfer.dll. Is it on your PATH? #3252

Closed My12123 closed 1 year ago

My12123 commented 1 year ago

Graphics processor 1 NVIDIA GeForce RTX 2060 SUPER Driver version: 31.0.15.3667 Date of development: 12.07.2023 DirectX Version: 12 (FL 12.1) Dedicated GPU memory 1.4/8.0 GB Total GPU memory 0.2/19.9 GB Graphics processor RAM 1.5/27.9 GB TensorRT-8.6.1.6

(venv) F:\FAST_Anime_VSR>python main.py
Traceback (most recent call last):
  File "F:\FAST_Anime_VSR\main.py", line 1, in <module>
    import tensorrt
  File "F:\FAST_Anime_VSR\venv\lib\site-packages\tensorrt\__init__.py", line 127, in <module>
    ctypes.CDLL(find_lib(lib))
  File "F:\FAST_Anime_VSR\venv\lib\site-packages\tensorrt\__init__.py", line 81, in find_lib
    raise FileNotFoundError(
FileNotFoundError: Could not find: nvinfer.dll. Is it on your PATH?
Note: Paths searched were:
['F:\\FAST_Anime_VSR\\venv\\Scripts', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.6\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.6\\libnvvp', 'C:\\VulkanSDK\\1.3.250.1\\Bin', 'C:\\Program Files (x86)\\CodeSynthesis XSD 4.0\\bin\\', 'C:\\Program Files (x86)\\CodeSynthesis XSD 4.0\\bin64\\', 'C:\\Program Files\\ImageMagick-7.1.1-Q16-HDRI', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\libnvvp', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.3\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.3\\libnvvp', 'C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\redist\\intel64_win\\compiler', 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath', 'C:\\ProgramData\\Oracle\\Java\\javapath', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\libnvvp', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\libnvvp', 'C:\\Windows\\system32', 'C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\', 'C:\\Windows\\System32\\OpenSSH\\', 'C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common', 'C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR', 'C:\\WINDOWS\\system32', 'C:\\WINDOWS', 'C:\\WINDOWS\\System32\\Wbem', 'C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\', 'C:\\WINDOWS\\System32\\OpenSSH\\', 'C:\\Program Files (x86)\\Boxcryptor\\bin\\', 'C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\', 'C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\', 'C:\\Program Files\\WireGuard\\', 'C:\\Program Files (x86)\\HP\\Common\\HPDestPlgIn\\', 'F:\\Git\\cmd', 'C:\\Program Files (x86)\\Sudowin\\Clients\\Console', 'C:\\Program Files\\nodejs\\', 'C:\\Program Files\\Docker\\Docker\\resources\\bin', 'F:\\New Folder\\', 'C:\\Program Files\\Cloudflare\\Cloudflare WARP\\', 'C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2022.1.0\\', 'C:\\Users\\tchot\\AppData\\Local\\Programs\\Python\\Python310\\Scripts\\', 'C:\\Users\\tchot\\AppData\\Local\\Programs\\Python\\Python310\\', 'C:\\Users\\tchot\\scoop\\shims', 'C:\\Users\\tchot\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\', 'C:\\Users\\tchot\\AppData\\Local\\Programs\\Python\\Python38\\', 'F:\\1\\envs\\mi1\\bin\\\\..\\extras\\CUPTI\\lib64', 'C:\\WINDOWS', 'C:\\WINDOWS', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\libnvvp', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.3\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.3\\libnvvp', 'C:\\Program Files (x86)\\Common Files\\Intel\\Shared Libraries\\redist\\intel64_win\\compiler', 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath', 'C:\\ProgramData\\Oracle\\Java\\javapath', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\libnvvp', 'C:\\Program Files\\Microsoft\\jdk-11.0.12.7-hotspot\\bin', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\bin', 'C:\\Program Files\\NVIDIA GP', 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.7\\bin\\nvinfer.dll', ''
### Tasks
- [x] Fix the "FileNotFoundError: Could not find: nvinfer.dll. Is it on your PATH?"

How to fix it?

zerollzeng commented 1 year ago

FileNotFoundError: Could not find: nvinfer.dll. Is it on your PATH?

This is not specific to TRT, I don't know about windows but I think this can be fixed by set the correct PATH.

My12123 commented 1 year ago

I fixed this by adding the necessary files to venv\Scripts

HePengguang commented 1 year ago

I fixed this by adding the necessary files to venv\Scripts

i met the same issue. but i cannot understand what you mean, could you please describe how you solve this problem? thank you so much.

My12123 commented 1 year ago

@HePengguang I use the following commands and actions.

python -m venv venv
call .\venv\Scripts\activate
@rem Pre-installation steps copy files from TensorRT\onnx_graphsurgeon and TensorRT\python and place in .\
@rem Post-Installation Steps: Download and copy files from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin and TensorRT\lib to .\venv\Scripts\
@rem This is necessary so as not to add to PATH.
Hogushake commented 1 year ago

@HePengguang It seems like the answer you're looking for is in this link. (https://cloud.tencent.com/developer/article/2169877)

Stephenjoel2k commented 11 months ago

@HePengguang It seems like the answer you're looking for is in this link. (https://cloud.tencent.com/developer/article/2169877)

Thanks, I had to copy the lib files to CUDA/11.x/bin and it fixed it!

Stefano19-Bongiovanni commented 3 months ago

I had the same issue, but after installing CUDA Toolkit i couldn't find the file. Does the file has been removed since v 12.x?

_I was trying to install ChatWithRTX (the exe installer failed on python dependencies), but the tensorrt crashed, the wheel file is tensorrt_llm-0.9.0-cp310-cp310-win_amd64.whl_

These are the files in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin

EDIT: I tried also installing version 11.8 and couldn't find nvinfer by searching in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\ directory