How to Install TensorRT?
The quick & dirty way of unpacking LizzieYZY and copying files from LizzieYZY\katago_tensorRT worked. However, I also want to use the official way by downloading from Nvidia. By getting relatively newer libraries, I hope for faster speed. Besides, we cannot rely on an unofficial installation forever because we do not know for how long LizzieYZY will be available and come with TensorRT library files. The official way should always work.
After a day of successfully installing Nvidia's CUDA and CuDNN, I do not succeed with Nvidia's TensorRT after another half a day. How to install Nvidia's TensorRT for Windows so that it works?
This is a quick summary of successfully installing Nvidia's CUDA and CuDNN:
Now to the problem of then installing Nvidia's TensorRT for Windows. Information is partially contradictory or outdated, and contains advanced stuff we probably do not need. This makes an already very difficult installation even more difficult.
Simply installing the most recent Nvidia versions of CUDA, CuDNN and TensorRT fails. They rely on CUDA 12 while KataGo still relies on CUDA 11. I have tried CUDA 12 and renamed two files but, although KataGo starts, one such library calls the other such library and expects the new file name. Therefore, instead we must use some archived Nvidia files for CUDA 11.
The KataGo download file names suggest that we need CUDA 11.2.2, CuDNN 8.5 for CUDA 11.2 and TensorRT 8.5 for CUDA 11.2. The closest download file names are cuda_11.2.2_461.33_win10.exe, cudnn-windows-x86_64-8.5.0.96_cuda11-archive.zip and TensorRT-8.5.3.1.Windows10.x86_64.cuda-11.8.cudnn8.6.zip, where confusingly the file name 8.5.3 denotes version 8.5 update 2. I have tried them but the TensorRT part fails.
However, one of Nvidia's installation manuals suggestions that this TensorRT version presumes CuDNN 8.6 instead of CuDNN 8.5. Needless to say, I have also tried that in vain.
This made me curios and I have studied the 11 quick & dirty working files from LizzieYZY:
Code:
cublas64_11.dll 11.6.1 file version 6.14.11
cublasLt64_11.dll 11.6.1 file version 6.14.11
cudart64_110.dll 11.4 file version 6.14.11
cudnn_cnn_infer64_8.dll 11.4 file version 6.14.11
cudnn_ops_infer64_8.dll 11.4 file version 6.14.11
cudnn64_8.dll 6.5.0 file version 6.14.11
msvcr110.dll \Windows\System32 version 11.0.51106.1
nvinfer.dll ?
nvinfer_builder_resource.dll ?
nvrtc64_112_0.dll 11.4 file version 6.14.11
nvrtc-builtins64_114.dll ?
Three of these files do not declare any versions. The other files mention the versions 11.6.1, 11.4, 6.14.11 and 6.5.0. Now, I have to guess: which of these versions refers to either CUDA, CuDNN or TensorRT? Surely, I cannot do 81 trial & error installations and deinstallations of all three packages! Which versions of CUDA, CuDNN or TensorRT for Windows should we download so that they will work together?
For CUDA and CuDNN to work and in the Windows system environment variables, I have had to set Path to Nvidia's \lib subdirectory. Additionally, I have set Path to the subdirectories \include and \bin in vain. Must there be yet another path to \lib\x64?
Then I have noticed that Nvidia's installation directory misses msvcr110.dll. The same file is, however in the Windows system directory C:\Windows\System32 and I have copied it to C:\katago_TensorRT. The Nvidia installer may have thought: already installed so no need to duplicate it. Fine. It should work being in at least one of the two directories.
For KataGo CUDA, I noticed that the Nvidia installer also did not duplicate zlibwapi.dll, which is in an arcane place on my PC so I have copied it to C:\katago_TensorRT. I do not know if it is needed for TensorRT. Anayway, after putting it there, this also cannot be the problem.
Then Nvidia's installation manuals talk about advanced stuff: Visual Studio Solution, Python, TensorFlow, PyTorch, the uff, graphsurgeon, onnx_graphsurgeon, Python wheel packages, and a build sample. I think that none of these are needed because the 11 quick & dirty LizzieYZY library files for TensorRT together with KataGo's unpacked libraries work by themselves without any need of the advanced stuff. Am I right or must all that also be installed properly?
How to get TensorRT working in Windows from Nvidia's own download files?
EDIT: My basic installation of the TensorRT part has been: