赞
踩
rm /etc/apt/sources.list
vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
确保内容跟上述图片一致
按esc键,再输入冒号+wq保存
sudo apt-get update
sudo apt upgrade
wget https://cn.download.nvidia.com/XFree86/Linux-x86_64/550.100/NVIDIA-Linux-x86_64-550.100.run
sudo apt-get install g++
点击回车enter即可
sudo apt-get install gcc
sudo apt-get install make
点击回车enter即可
成功安装
sudo apt-get remove --purge nvidia*
sudo vim /etc/modprobe.d/blacklist.conf
blacklist nouveau
options nouveau modeset=0
3.按esc键退出编辑模式,输入:wq保存并退出
4.更新文件
sudo update-initramfs -u
这里等待时间较久
sudo reboot
这里需要等一会才能连上
sudo chmod 777 NVIDIA-Linux-x86_64-550.100.run
sudo ./NVIDIA-Linux-x86_64-550.100.run
这里一直按回车就行,默认选择
一直按回车enter键,直到安装成功
nvidia-smi
wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
执行安装命令
sudo sh ./cuda_12.4.0_550.54.14_linux.run
sudo vim ~/.bashrc
export PATH="/usr/local/cuda-12.4/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH"
按esc键退出编辑模式,输入:wq保存并退出
3.更新环境变量
source ~/.bashrc
nvcc -V
wget https://mirrors.cqupt.edu.cn/anaconda/miniconda/Miniconda3-py310_23.10.0-1-Linux-x86_64.sh
bash Miniconda3-py310_23.10.0-1-Linux-x86_64.sh -u
直接一直enter键,到输入路径和yes
这边建议路径为:miniconda3
直接回车enter即可,再次输入yes
成功安装
cd miniconda3/bin/
pwd
复制这里的路径
vim ~/.bashrc
export PATH="/root/miniconda3/bin:$PATH"
按esc键退出编辑模式,输入:wq保存并退出
source ~/.bashrc
conda init bash
conda -V
1.配置清华镜像源
代码如下:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
git clone https://github.com/Stability-AI/stable-fast-3d.git
https://mirror.ghproxy.com/
镜像源git clone https://mirror.ghproxy.com/https://github.com/Stability-AI/stable-fast-3d.git
cd stable-fast-3d
git+https://github.com/vork/PyNanoInstantMeshes.git
改为
git+https://mirror.ghproxy.com/https://github.com/vork/PyNanoInstantMeshes.git
conda create -n 3d python=3.9
conda activate 3d
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-demo.txt
export HF_ENDPOINT=https://hf-mirror.com
python gradio_app.py
wget https://mirror.ghproxy.com/https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx /root/.u2net/u2net.onnx
mkdir models
cd models
pip install modelscope
modelscope download --model maple77/stable-fast-3d --local_dir './'
model = SF3D.from_pretrained(
"stabilityai/stable-fast-3d",
config_name="config.yaml",
weight_name="model.safetensors",
)
模型文件路径指定到刚才下载的路径
model = SF3D.from_pretrained(
"/root/project/stable-fast-3d/models/",
config_name="config.yaml",
weight_name="model.safetensors",
)
demo.queue().launch(share=False)
改为
demo.queue().launch(server_name="0.0.0.0", server_port=15119)
server_port变量为设置服务器监听的端口为业务端口,此处改为业务端口。
python gradio_app.py
启动成功后,访问http://主机IP:端口
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。