I want to create a minimal linux image with the prebuild pytorch 2.0.0 installed following the installation guide. My question is which jetpack packages do I need for pytorch to work? I installed the following packages sudo apt install cuda-toolkit-11.4 nvidia-cudnn8. With these packages import torch works but they are quite big. Can I install less big packages to get pytorch working? For instance do I even need to install cudnn or is it included in the pytorch wheel?
Hi @Xennor, I haven’t personally tried this before so I’m not sure what the exact list of required packages is, but I would start by inspecting which libraries the torch C modules link against:
Completely unrelated to this is that cudnn does not match the prebuild pytorch 2.0.0 version:
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.backends.cudnn.version()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/el_seamsensor/.local/lib/python3.8/site-packages/torch/backends/cudnn/__init__.py", line 70, in version
if not _init():
File "/home/el_seamsensor/.local/lib/python3.8/site-packages/torch/backends/cudnn/__init__.py", line 52, in _init
raise RuntimeError(f'{base_error_msg}'
RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (8, 6, 0) but found runtime version (8, 4, 1). PyTorch already comes bundled with cuDNN. One option to resolving this error is to ensure PyTorch can find the bundled cuDNN.Looks like your LD_LIBRARY_PATH contains incompatible version of cudnnPlease either remove it from the path or install cudnn (8, 6, 0)
This was from JetPack 5.1 and shows cuDNN 8.6. Which version of JetPack are you running? I’d recommend upgrading to the latest to be compatible with that PyTorch wheel (or try an older PyTorch wheel)
cat /etc/nv_tegra_release
# R35 (release), REVISION: 3.1, GCID: 32827747, BOARD: t186ref, EABI: aarch64, DATE: Sun Mar 19 15:19:21 UTC 2023
cat /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
deb https://repo.download.nvidia.com/jetson/common r35.1 main
deb https://repo.download.nvidia.com/jetson/t194 r35.1 main