A1——基于AMD-48G显卡下载Gemma4模型

一、基础指令:显卡信息

复制代码
amd-smi

二、安装 Python 进行测试

python 复制代码
import torch
import os

print('PyTorch:', torch.__version__)
print("HIP_VISIBLE_DEVICES:", os.environ.get("HIP_VISIBLE_DEVICES","not set"))
print('torch.cuda.is_available():', torch.cuda.is_available())

if torch.cuda.is_available():
    print('Device count:', torch.cuda.device_count())
    print('Device 0 name:', torch.cuda.get_device_name(0))
    # 做一次简单显存分配测试
    x = torch.randn(1024,1024).cuda()
    print("GPU张量创建成功 ✔")
else:
    print("❌ 无法识别AMD GPU,说明当前PyTorch不是ROCm编译版本")

执行指令:

python 复制代码
python ./amd_text.py

三、使用魔搭社区进行模型创建,设置腾讯源

python 复制代码
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple/

安装魔搭:

python 复制代码
pip install modelscope

下载 Gemma4 模型到当前目录(16G,略慢)

python 复制代码
modelscope download --model google/gemma-4-E4B-it --cache_dir "./models"

查看模型的权重文件15G的那个

python 复制代码
ls -lh ./models/models/google--gemma-4-E4B-it/snapshots/master

如果有则下载完成

相关推荐
未济1 天前
linux 配置环境变量
linux
傲世仙尊1 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.1 天前
进程间通信
linux
Liuqy-051 天前
Linux IO编程——静态库、动态库
linux
彧azz1 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅1 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK1 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖1 天前
SimlpeHttp
linux·服务器
qeen871 天前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程
Zenova EdgeOS1 天前
Linux ss 工业边缘网络分析实战
linux·python·边缘计算·工业网关