Iinux Fedora Pytorch install GraKa. Nvidia?

Gregorie

Lieutenant
Registriert
Apr. 2017
Beiträge
626
Hallo
vorweg ich programmiere nicht selbst, ich will nur ein Python Programm zum laufen bringen unter Fedora Linux, welches unter Windows 10 funktioniert. Dieses Programm setzt Pytorch voraus.
Meine Umgebung: Conda Python 3.10,
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Cuda compilation tools, release 12.2, V12.2.140
Build cuda_12.2.r12.2/compiler.33191640_0

Zuletzt gab es ständig Fehlermeldungen wegen Torch, Torchaudio, Torchvision Versionskonflikte.
Das Python Projekt hat ein Cuda Setup.sh speziell für Nvidia GPU.
Dort wird angegeben zur inst. pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Wie gesagt bringt mir das Fehlemeldungen.
Ich versuchte auch schon selbst Pytorch manuell zu installieren.
https://pytorch.org/get-started/previous-version
Welches Pytorch brauche ich denn nun Cuda, Conda oder Wheel?

Laut pip list, ist aktuell installiert
torch 2.0.1
torchaudio 2.0.2
torchvision 0.15.2

conda list
pytorch 2.0.1 py3.10_cuda11.8_cudnn8.7.0_0 pytorch
pytorch-cuda 11.8 h7e8668a_5 pytorch
pytorch-mutex 1.0 cuda pytorch
torchaudio 2.0.2 py310_cu118 pytorch
torchtriton 2.0.0 py310 pytorch
torchvision 0.15.2 py310_cu118 pytorch
 
Zuletzt bearbeitet:
Pytorch ist eine komplexe Sache.

Gregorie schrieb:
Zuletzt gab es ständig Fehlermeldungen

Was soll "zuletzt" bedeuten?
Ging es vor "zuletzt"?
Zuletzt lief mein VW Passat nicht...... Finde den Fehler.


Liste mal auf was Du alles aufgeführt hast.
Was
Wie
Wann
Warum

Gregorie schrieb:
Wie gesagt bringt mir das Fehlemeldungen

Gab es einen Versuch diese zu interpretieren oder könnten die evtl. sogar gepostet werden?

Dein erster Link führt in ein Unterverzeichnis.
Der zweite funktioniert nicht.
Was Du brauchst hängt von deiner Hardware und von deinen Zielen/Fähigkeiten/Bedürfnissen ab, zu denen keinerlei Angaben gemacht wurden.
 
Es das Projekt: https://git.ecker.tech/mrq/ai-voice-cloning
Anaconda habe ich installiert.
Conda activate "name"
Ich führe nun dieses setup-cuda.sh der Repo aus:
git submodule init
git submodule update --remote
python -m venv venv
call .\venv\Scripts\activate.bat
python -m pip install --upgrade pip
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
python -m pip install -r .\modules\tortoise-tts\requirements.txt
python -m pip install -e .\modules\tortoise-tts\
python -m pip install -r .\modules\dlas\requirements.txt
python -m pip install -e .\modules\dlas\
python -m pip install -r .\requirements.txt
# setup BnB
.\setup-cuda-bnb.bat
del *.sh
pause
deactivate

Viele Pakete sind bereits installiert in venv/lib/python3.10/site-packages (Unterordner der geklonten Repo). Am Schluss:
Code:
Installing collected packages: triton, torch

 Attempting uninstall: triton
 Found existing installation: triton 2.1.0
 Uninstalling triton-2.1.0:
 uccessfully uninstalled triton-2.1.0
 Attempting uninstall: torch
 Found existing installation: torch 2.1.0+cu118
 Uninstalling torch-2.1.0+cu118:
 Successfully uninstalled torch-2.1.0+cu118
 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
 torchaudio 2.1.0+cu118 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.
 torchvision 0.16.0+cu118 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.
 Successfully installed torch-2.0.1 triton-2.0.0

Ich habe, wie gesagt keine Ahnung vom Programmieren. Wenn das Programm unter Windows funktioniert, sollte es doch auch unter Linux gehen.
Ergänzung ()

Es das Projekt: https://git.ecker.tech/mrq/ai-voice-cloning
Anaconda habe ich installiert.
Conda activate "name"
Ich führe nun dieses setup-cuda.sh der Repo aus:
git submodule init
git submodule update --remote
python -m venv venv
call .\venv\Scripts\activate.bat
python -m pip install --upgrade pip
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
python -m pip install -r .\modules\tortoise-tts\requirements.txt
python -m pip install -e .\modules\tortoise-tts\
python -m pip install -r .\modules\dlas\requirements.txt
python -m pip install -e .\modules\dlas\
python -m pip install -r .\requirements.txt
# setup BnB
.\setup-cuda-bnb.bat
del *.sh
pause
deactivate

Viele Pakete sind bereits installiert in venv/lib/python3.10/site-packages (Unterordner der geklonten Repo). Am Schluss:
Installing collected packages: triton, torch

Attempting uninstall: triton
Found existing installation: triton 2.1.0
Uninstalling triton-2.1.0:
uccessfully uninstalled triton-2.1.0
Attempting uninstall: torch
Found existing installation: torch 2.1.0+cu118
Uninstalling torch-2.1.0+cu118:
Successfully uninstalled torch-2.1.0+cu118
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchaudio 2.1.0+cu118 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.
torchvision 0.16.0+cu118 requires torch==2.1.0, but you have torch 2.0.1 which is incompatible.
Successfully installed torch-2.0.1 triton-2.0.0

Anschließend ./start.sh:
Code:
Traceback (most recent call last):
  File "/home/bill/ai-voice-cloning/./src/main.py", line 11, in <module>
    from utils import *
  File "/home/bill/ai-voice-cloning/src/utils.py", line 29, in <module>
    import torchaudio
  File "/home/bill/ai-voice-cloning/venv/lib/python3.10/site-packages/torchaudio/[B]init[/B].py", line 1, in <module>
    from . import (  # noqa: F401
  File "/home/bill/ai-voice-cloning/venv/lib/python3.10/site-packages/torchaudio/[I]extension/__init_[/I].py", line 45, in <module>
    _load_lib("libtorchaudio")
  File "/home/bill/ai-voice-cloning/venv/lib/python3.10/site-packages/torchaudio/_extension/utils.py", line 64, in _load_lib
    torch.ops.load_library(path)
  File "/home/bill/ai-voice-cloning/venv/lib/python3.10/site-packages/torch/_ops.py", line 643, in load_library
    ctypes.CDLL(path)
  File "/home/bill/.conda/envs/vitzVoice/lib/python3.10/ctypes/[B]init[/B].py", line 374, in [B]init[/B]
    self._handle = _dlopen(self._name, mode)
OSError: /home/bill/ai-voice-cloning/venv/lib/python3.10/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda9SetDeviceEi

Python import torch, no module Torch

Ich habe, wie gesagt keine Ahnung vom Programmieren. Wenn das Programm unter Windows funktioniert, sollte es doch auch unter Linux gehen.
 
Zuletzt bearbeitet:
warum nutzt du eigentlich Anaconda wenn das Script eh ein venv nutzt?

warum genau machst du das hier? Also was soll die Windows Batch Datei unter Linux machen?
.\setup-cuda-bnb.bat
Das Docker Setup willst du nicht nutzen?
 
  • Gefällt mir
Reaktionen: Gregorie
@abcddcba
Ohne Benutzung von anaconda bekomme ich dieselben Fehlermeldungen, gerade nochmal probiert.
Ich werde es nochmal probieren, zuvor die vorhandenen venv löschen.
Das setup-docker.sh habe ich auch schon probiert, ca. 28GB image.
Code:
/start-docker.sh

==========
== CUDA ==
==========

CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

Traceback (most recent call last):
  File "/home/user/ai-voice-cloning/./src/main.py", line 11, in <module>
    from utils import *
  File "/home/user/ai-voice-cloning/src/utils.py", line 29, in <module>
    import torchaudio
  File "/home/user/miniconda/lib/python3.9/site-packages/torchaudio/__init__.py", line 1, in <module>
    from . import (  # noqa: F401
  File "/home/user/miniconda/lib/python3.9/site-packages/torchaudio/_extension/__init__.py", line 45, in <module>
    _load_lib("libtorchaudio")
  File "/home/user/miniconda/lib/python3.9/site-packages/torchaudio/_extension/utils.py", line 64, in _load_lib
    torch.ops.load_library(path)
  File "/home/user/miniconda/lib/python3.9/site-packages/torch/_ops.py", line 643, in load_library
    ctypes.CDLL(path)
  File "/home/user/miniconda/lib/python3.9/ctypes/__init__.py", line 382, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/user/miniconda/lib/python3.9/site-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda9SetDeviceEi

O.k. da steht noch ein Verweis auf miniconda und Python 3.9, muss ich wahrscheinlich korrigieren.
Mit docker habe ich auch noch nie was gemacht.
 
Ich habe das Ganze mit ./setup-docker.sh nochmals neu durchgeführt und zuvor die vorhandenen Docker Container und Images gelöscht.
Wieder das gleiche danach bei ./start-docker.sh, Error wie oben, wieso wird auf Miniconda miniconda/lib/python3.9/site-packages verwiesen. Sollte ich miniconda bei mir testhalber deinstallieren?
Wobei /home/user ist doch bei Windows die Umgebung, bei linux heißt es doch /usr oder?
Ist das docker Image eigentlich aus einer Windows-Umgebung erzeugt worden?

Edit: Das mit miniconda stammt doch aus dem Dockerfile, hat nichts mit meinem installierten anaconda unter Linux zu tun. Nun gut unter Linux läuft es bei mir so oder so nicht.
 
Zuletzt bearbeitet:
Zurück
Oben