From b114eefb80532908fee3346d14d4deb3626d7f51 Mon Sep 17 00:00:00 2001 From: C3EZ <96614352+luckykevvv@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:42:17 +0800 Subject: [PATCH 1/6] Added the instruction for AMD GPU in English --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a3f5966c..07c1eec7 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,15 @@ brew install ffmpeg pip install -r requirements.txt ``` +##### AMD GPU only + +After installed the dependences above + +```bash +pip3 uninstall torch torchvision torchaudio +pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2.4 +``` + ### Using Docker #### docker-compose.yaml configuration From e077944d90e10c38d65b602aa09ab010da5f7ac2 Mon Sep 17 00:00:00 2001 From: C3EZ <96614352+luckykevvv@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:44:06 +0800 Subject: [PATCH 2/6] Added the instruction for AMD GPU in Chinese --- docs/cn/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/cn/README.md b/docs/cn/README.md index a0631283..82f5d05c 100644 --- a/docs/cn/README.md +++ b/docs/cn/README.md @@ -112,6 +112,15 @@ brew install ffmpeg pip install -r requirements.txt ``` +##### 使用AMD显卡 + +在安装完依赖以后 + +```bash +pip3 uninstall torch torchvision torchaudio +pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2.4 +``` + ### 在 Docker 中使用 #### docker-compose.yaml 设置 From 258caea61bd4a8680b441438481b6299eec689ce Mon Sep 17 00:00:00 2001 From: C3EZ <96614352+luckykevvv@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:54:29 +0800 Subject: [PATCH 3/6] Update install.sh, now it will check wether user are using cuda or rocm --- install.sh | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8dadb26d..7b5fca46 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,62 @@ #!/bin/bash +echo "Installing GCC..." conda install -c conda-forge gcc + +echo "Installing G++..." conda install -c conda-forge gxx + +echo "Installing ffmpeg and cmake..." conda install ffmpeg cmake -conda install pytorch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 pytorch-cuda=11.8 -c pytorch -c nvidia + +echo "Checking for CUDA installation..." +if command -v nvcc &> /dev/null; then + USE_CUDA=true + echo "CUDA found." +else + echo "CUDA not found." + USE_CUDA=false +fi + + +if [ "$USE_CUDA" = false ]; then + echo "Checking for ROCm installation..." + if [ -d "/opt/rocm" ]; then + USE_ROCM=true + echo "ROCm found." + if grep -qi "microsoft" /proc/version; then + echo "You are running WSL." + IS_WSL=true + else + echo "You are NOT running WSL." + IS_WSL=false + fi + else + echo "ROCm not found." + USE_ROCM=false + fi +fi + +if [ "$USE_CUDA" = true ]; then + echo "Installing PyTorch with CUDA support..." + conda install pytorch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 pytorch-cuda=11.8 -c pytorch -c nvidia +elif [ "$USE_ROCM" = true ] ; then + echo "Installing PyTorch with ROCm support..." + pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/rocm6.2 +else + echo "Installing PyTorch for CPU..." + conda install pytorch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 cpuonly -c pytorch +fi + + +echo "Installing Python dependencies from requirements.txt..." pip install -r requirements.txt + +if [ "$USE_ROCM" = true ] && [ "$IS_WSL" = true ] ; then + echo "Update to WSL compatible runtime lib..." + location=`pip show torch | grep Location | awk -F ": " '{print $2}'` + cd ${location}/torch/lib/ + rm libhsa-runtime64.so* + cp /opt/rocm/lib/libhsa-runtime64.so.1.2 libhsa-runtime64.so +fi + +echo "Installation completed successfully!" From 4b11f80d73be58e0c92e519e202ffbcca7382a43 Mon Sep 17 00:00:00 2001 From: C3EZ <96614352+luckykevvv@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:01:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=84readme=EF=BC=8C=E5=B7=B2=E7=BB=8F=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BA=86install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 07c1eec7..a3f5966c 100644 --- a/README.md +++ b/README.md @@ -115,15 +115,6 @@ brew install ffmpeg pip install -r requirements.txt ``` -##### AMD GPU only - -After installed the dependences above - -```bash -pip3 uninstall torch torchvision torchaudio -pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2.4 -``` - ### Using Docker #### docker-compose.yaml configuration From f7dc7124a62d69c85a8e66d323f9bd1fdd28d40a Mon Sep 17 00:00:00 2001 From: C3EZ <96614352+luckykevvv@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:02:15 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=B8=AD=E6=96=87readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/cn/README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/cn/README.md b/docs/cn/README.md index 82f5d05c..a0631283 100644 --- a/docs/cn/README.md +++ b/docs/cn/README.md @@ -112,15 +112,6 @@ brew install ffmpeg pip install -r requirements.txt ``` -##### 使用AMD显卡 - -在安装完依赖以后 - -```bash -pip3 uninstall torch torchvision torchaudio -pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2.4 -``` - ### 在 Docker 中使用 #### docker-compose.yaml 设置 From 3c98f6134f5e4523205b571853dc54fd14f3db3e Mon Sep 17 00:00:00 2001 From: C3EZ <96614352+luckykevvv@users.noreply.github.com> Date: Wed, 19 Feb 2025 22:34:28 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=B0=86n=E5=8D=A1=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=9D=A1=E4=BB=B6=E7=94=B1nvcc=E6=94=B9=E6=88=90nvidi?= =?UTF-8?q?a-smi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 7b5fca46..1fdd68bd 100644 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ echo "Installing ffmpeg and cmake..." conda install ffmpeg cmake echo "Checking for CUDA installation..." -if command -v nvcc &> /dev/null; then +if command -v nvidia-smi &> /dev/null; then USE_CUDA=true echo "CUDA found." else