1.准备工作

➜  hxtest python3 100memory.py
Traceback (most recent call last):
  File "/root/xinglin-data/hxtest/100memory.py", line 10, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
➜  hxtest
➜  hxtest
➜  hxtest
➜  hxtest
➜  hxtest pip3 install numpy psutil matplotlib
Looking in indexes: http://mirrors.chukk.cc:7104/xinglin/devpi/+simple/
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (1.26.4)
Requirement already satisfied: psutil in /usr/local/lib/python3.9/dist-packages (5.9.8)
Collecting matplotlib
  Downloading http://mirrors.chukk.cc:7104/xinglin/pypi/%2Bf/57a/a235109e9eed5/matplotlib-3.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.3/8.3 MB 37.7 MB/s eta 0:00:00
Collecting contourpy>=1.0.1 (from matplotlib)
  Downloading http://mirrors.chukk.cc:7104/xinglin/pypi/%2Bf/68a/32389b06b82c2/contourpy-1.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (321 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 321.9/321.9 kB 9.8 MB/s eta 0:00:00
Collecting cycler>=0.10 (from matplotlib)
  Downloading http://mirrors.chukk.cc:7104/xinglin/devpi/%2Bf/85c/ef7cff222d864/cycler-0.12.1-py3-none-any.whl (8.3 kB)
Collecting fonttools>=4.22.0 (from matplotlib)
  Downloading http://mirrors.chukk.cc:7104/xinglin/pypi/%2Bf/5f3/f021cea6e3641/fonttools-4.59.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 29.7 MB/s eta 0:00:00
Collecting kiwisolver>=1.3.1 (from matplotlib)
  Downloading http://mirrors.chukk.cc:7104/xinglin/pypi/%2Bf/dda/56c24d869b119/kiwisolver-1.4.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 13.3 MB/s eta 0:00:00
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from matplotlib) (24.0)
Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.9/dist-packages (from matplotlib) (10.2.0)
Collecting pyparsing>=2.3.1 (from matplotlib)
  Downloading http://mirrors.chukk.cc:7104/xinglin/pypi/%2Bf/a74/9938e02d6fd0b/pyparsing-3.2.3-py3-none-any.whl (111 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 111.1/111.1 kB 11.5 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.9/dist-packages (from matplotlib) (2.9.0.post0)
Collecting importlib-resources>=3.2.0 (from matplotlib)
  Downloading http://mirrors.chukk.cc:7104/xinglin/pypi/%2Bf/789/cfdc3ed28c78b/importlib_resources-6.5.2-py3-none-any.whl (37 kB)
Requirement already satisfied: zipp>=3.1.0 in /usr/local/lib/python3.9/dist-packages (from importlib-resources>=3.2.0->matplotlib) (3.18.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/dist-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
Installing collected packages: pyparsing, kiwisolver, importlib-resources, fonttools, cycler, contourpy, matplotlib
Successfully installed contourpy-1.3.0 cycler-0.12.1 fonttools-4.59.1 importlib-resources-6.5.2 kiwisolver-1.4.7 matplotlib-3.9.4 pyparsing-3.2.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 24.0 -> 25.2
[notice] To update, run: python3 -m pip install --upgrade pip
➜  hxtest
➜  hxtest
➜  hxtest
➜  hxtest
➜  hxtest pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Looking in indexes: https://download.pytorch.org/whl/cu118
Requirement already satisfied: torch in /usr/local/lib/python3.9/dist-packages (2.0.1+cu117)
Requirement already satisfied: torchvision in /usr/local/lib/python3.9/dist-packages (0.15.2+rocm5.4.2)
Requirement already satisfied: torchaudio in /usr/local/lib/python3.9/dist-packages (2.0.2+cu117)
Requirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from torch) (3.13.1)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.9/dist-packages (from torch) (4.10.0)
Requirement already satisfied: sympy in /usr/local/lib/python3.9/dist-packages (from torch) (1.12)
Requirement already satisfied: networkx in /usr/local/lib/python3.9/dist-packages (from torch) (3.2.1)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/dist-packages (from torch) (3.1.3)
Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.9/dist-packages (from torch) (2.0.0)
Requirement already satisfied: cmake in /usr/local/lib/python3.9/dist-packages (from triton==2.0.0->torch) (3.28.3)
Requirement already satisfied: lit in /usr/local/lib/python3.9/dist-packages (from triton==2.0.0->torch) (18.1.1)
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from torchvision) (1.26.4)
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from torchvision) (2.31.0)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.9/dist-packages (from torchvision) (10.2.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.9/dist-packages (from jinja2->torch) (2.1.5)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision) (2024.2.2)
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.9/dist-packages (from sympy->torch) (1.3.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 24.0 -> 25.2
[notice] To update, run: python3 -m pip install --upgrade pip
➜  hxtest

2.测试代码部分 python

import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import time
import threading
import psutil
import gc
from datetime import datetime
import matplotlib.pyplot as plt
from typing import List, Dict, Any
import json

class MemoryMonitor:
    """实时内存监控器"""
    
    def __init__(self, interval: float = 1.0):
        self.interval = interval
        self.memory_stats = []
        self.running = False
        self.monitor_thread = None
        
    def start_monitoring(self):
        """开始监控内存使用情况"""
        self.running = True
        self.monitor_thread = threading.Thread(target=self._monitor_loop)
        self.monitor_thread.daemon = True
        self.monitor_thread.start()
        print("内存监控已启动...")
        
    def _monitor_loop(self):
        """监控循环"""
        while self.running:
            # 获取内存信息
            memory_info = psutil.virtual_memory()
            gpu_memory = self._get_gpu_memory()
            
            stats = {
                'timestamp': time.time(),
                'total_memory_gb': memory_info.total / (1024**3),
                'used_memory_gb': memory_info.used / (1024**3),
                'available_memory_gb': memory_info.available / (1024**3),
                'memory_percent': memory_info.percent,
                'gpu_memory_mb': gpu_memory
            }
            
            self.memory_stats.append(stats)
            
            # 实时输出内存状态
            print(f"\r内存使用: {stats['used_memory_gb']:.1f}GB/{stats['total_memory_gb']:.1f}GB "
                  f"({stats['memory_percent']:.1f}%) | GPU内存: {stats['gpu_memory_mb']}MB", 
                  end='', flush=True)
            
            time.sleep(self.interval)
    
    def _get_gpu_memory(self) -> int:
        """获取GPU内存使用情况"""
        try:
            if torch.cuda.is_available():
                return torch.cuda.memory_allocated() // (1024 * 1024)  # MB
            return 0
        except:
            return 0
    
    def stop_monitoring(self):
        """停止监控"""
        self.running = False
        if self.monitor_thread:
            self.monitor_thread.join(timeout=2.0)
        print("\n内存监控已停止")
    
    def generate_report(self):
        """生成内存使用报告"""
        if not self.memory_stats:
            return
        
        # 创建图表
        timestamps = [s['timestamp'] - self.memory_stats[0]['timestamp'] for s in self.memory_stats]
        memory_used = [s['used_memory_gb'] for s in self.memory_stats]
        
        plt.figure(figsize=(12, 8))
        plt.plot(timestamps, memory_used, 'b-', linewidth=2)
        plt.xlabel('时间 (秒)')
        plt.ylabel('内存使用 (GB)')
        plt.title('内存使用情况监控')
        plt.grid(True)
        plt.savefig('memory_usage.png')
        plt.close()
        
        # 保存详细数据
        with open('memory_stats.json', 'w') as f:
            json.dump(self.memory_stats, f, indent=2)
        
        print(f"监控报告已生成: memory_usage.png, memory_stats.json")

class ComplexModel(nn.Module):
    """复杂的深度学习模型,设计用于消耗大量内存"""
    
    def __init__(self, input_size: int = 1024, hidden_size: int = 4096, num_layers: int = 20):
        super(ComplexModel, self).__init__()
        
        self.layers = nn.ModuleList()
        
        # 创建深度网络层
        for i in range(num_layers):
            in_features = input_size if i == 0 else hidden_size
            out_features = hidden_size if i < num_layers - 1 else input_size
            
            layer = nn.Sequential(
                nn.Linear(in_features, out_features),
                nn.ReLU(),
                nn.Dropout(0.1),
                nn.BatchNorm1d(out_features)
            )
            self.layers.append(layer)
        
        # 额外的并行分支
        self.parallel_branches = nn.ModuleList([
            self._create_branch(input_size, hidden_size) for _ in range(4)
        ])
        
    def _create_branch(self, input_size: int, hidden_size: int) -> nn.Module:
        """创建网络分支"""
        return nn.Sequential(
            nn.Linear(input_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, input_size)
        )
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        # 主分支前向传播
        for layer in self.layers:
            x = layer(x)
        
        # 并行分支
        branch_outputs = []
        for branch in self.parallel_branches:
            branch_outputs.append(branch(x))
        
        # 合并分支输出
        x = torch.stack(branch_outputs).mean(dim=0)
        
        return x

class MemoryIntensiveOperations:
    """内存密集型操作"""
    
    def __init__(self, target_memory_gb: int = 100):
        self.target_memory_gb = target_memory_gb
        self.data_buffers = []
        
    def allocate_large_arrays(self):
        """分配大型数组来消耗内存"""
        print(f"\n开始分配内存,目标: {self.target_memory_gb}GB")
        
        # 计算需要分配的元素数量
        bytes_per_float32 = 4  # 每个float32占4字节
        elements_needed = int((self.target_memory_gb * 1024**3) / bytes_per_float32)
        
        # 分批分配以避免单次分配过大
        chunk_size = 10**8  # 每次分配1亿个元素 ≈ 0.37GB
        num_chunks = max(1, elements_needed // chunk_size)
        
        total_allocated = 0
        
        for i in range(num_chunks):
            try:
                # 在CPU上分配大型数组
                chunk = np.random.rand(chunk_size).astype(np.float32)
                self.data_buffers.append(chunk)
                
                total_allocated += chunk.nbytes / (1024**3)  # GB
                
                current_memory = psutil.virtual_memory().used / (1024**3)
                print(f"已分配: {total_allocated:.1f}GB | 当前总内存: {current_memory:.1f}GB")
                
                # 稍微暂停以避免过度分配
                time.sleep(0.1)
                
            except MemoryError:
                print(f"\n内存分配达到极限,已分配 {total_allocated:.1f}GB")
                break
        
        return total_allocated
    
    def perform_memory_operations(self):
        """执行内存密集型操作"""
        if not self.data_buffers:
            print("没有数据可操作")
            return
        
        print("\n开始执行内存密集型操作...")
        
        # 各种内存操作
        operations = [
            self._matrix_multiplications,
            self._sort_operations,
            self._statistical_operations,
            self._transform_operations
        ]
        
        for i, operation in enumerate(operations):
            print(f"执行操作 {i+1}/{len(operations)}...")
            operation()
            time.sleep(1)
    
    def _matrix_multiplications(self):
        """矩阵乘法操作"""
        for i, buffer in enumerate(self.data_buffers[:10]):  # 只处理前10个缓冲区
            if len(buffer) >= 10000:
                # 重塑为矩阵并进行乘法
                size = int(np.sqrt(len(buffer) // 100)) * 10
                if size > 1:
                    matrix = buffer[:size*size].reshape(size, size)
                    result = np.dot(matrix, matrix.T)
                    del result
    
    def _sort_operations(self):
        """排序操作"""
        for buffer in self.data_buffers[:5]:
            np.sort(buffer)
    
    def _statistical_operations(self):
        """统计操作"""
        for buffer in self.data_buffers:
            _ = np.mean(buffer)
            _ = np.std(buffer)
            _ = np.sum(buffer)
    
    def _transform_operations(self):
        """变换操作"""
        for buffer in self.data_buffers:
            _ = np.fft.fft(buffer)
            _ = buffer * 2.0
            _ = np.sin(buffer)

class GPUIntensiveOperations:
    """GPU密集型操作"""
    
    def __init__(self, device: torch.device):
        self.device = device
        self.model = None
        self.optimizer = None
        
    def setup_model(self):
        """设置复杂模型"""
        print("设置复杂深度学习模型...")
        
        # 创建复杂模型
        self.model = ComplexModel(
            input_size=2048,      # 更大的输入尺寸
            hidden_size=8192,     # 更大的隐藏层
            num_layers=25         # 更多层数
        ).to(self.device)
        
        # 创建优化器
        self.optimizer = optim.AdamW(self.model.parameters(), lr=1e-4, weight_decay=1e-5)
        
        # 打印模型参数数量
        total_params = sum(p.numel() for p in self.model.parameters())
        print(f"模型参数数量: {total_params:,}")
        print(f"模型大小: {total_params * 4 / (1024**2):.1f}MB")
    
    def run_training(self, num_batches: int = 100, batch_size: int = 64):
        """运行训练过程"""
        if self.model is None:
            self.setup_model()
        
        print(f"\n开始GPU训练: {num_batches}个批次, 批次大小: {batch_size}")
        
        self.model.train()
        
        for batch_idx in range(num_batches):
            # 生成随机数据
            inputs = torch.randn(batch_size, 2048, device=self.device)
            targets = torch.randn(batch_size, 2048, device=self.device)
            
            # 前向传播
            self.optimizer.zero_grad()
            outputs = self.model(inputs)
            
            # 计算损失
            loss = nn.MSELoss()(outputs, targets)
            
            # 反向传播
            loss.backward()
            
            # 优化步骤
            self.optimizer.step()
            
            # 打印进度
            if (batch_idx + 1) % 10 == 0:
                gpu_memory = torch.cuda.memory_allocated() / (1024**3)
                print(f"批次 {batch_idx + 1}/{num_batches} | 损失: {loss.item():.6f} | GPU内存: {gpu_memory:.1f}GB")
            
            # 清理中间变量
            del inputs, targets, outputs, loss
            
        print("GPU训练完成")

def main():
    """主函数"""
    print("=" * 60)
    print("RTX 3090 复杂模型训练与内存监控程序")
    print("=" * 60)
    
    # 检查CUDA可用性
    if not torch.cuda.is_available():
        print("错误: CUDA不可用")
        return
    
    device = torch.device('cuda:0')
    print(f"使用设备: {torch.cuda.get_device_name(device)}")
    print(f"GPU内存: {torch.cuda.get_device_properties(device).total_memory / (1024**3):.1f}GB")
    
    # 初始化内存监控器
    monitor = MemoryMonitor(interval=0.5)
    monitor.start_monitoring()
    
    try:
        # 阶段1: 分配大量CPU内存
        print("\n" + "="*50)
        print("阶段1: CPU内存分配")
        print("="*50)
        
        memory_ops = MemoryIntensiveOperations(target_memory_gb=100)
        allocated_gb = memory_ops.allocate_large_arrays()
        
        print(f"\n成功分配 {allocated_gb:.1f}GB 内存")
        time.sleep(2)
        
        # 阶段2: 执行内存密集型操作
        print("\n" + "="*50)
        print("阶段2: 内存密集型操作")
        print("="*50)
        
        memory_ops.perform_memory_operations()
        time.sleep(1)
        
        # 阶段3: GPU密集型操作
        print("\n" + "="*50)
        print("阶段3: GPU模型训练")
        print("="*50)
        
        gpu_ops = GPUIntensiveOperations(device)
        gpu_ops.run_training(num_batches=200, batch_size=128)
        
        # 阶段4: 混合操作
        print("\n" + "="*50)
        print("阶段4: 混合CPU-GPU操作")
        print("="*50)
        
        # 同时进行CPU和GPU操作
        for i in range(5):
            print(f"混合操作迭代 {i+1}/5")
            
            # CPU操作
            memory_ops.perform_memory_operations()
            
            # GPU操作
            gpu_ops.run_training(num_batches=20, batch_size=64)
            
            time.sleep(1)
        
        print("\n所有操作完成!")
        
    except Exception as e:
        print(f"程序执行出错: {e}")
        import traceback
        traceback.print_exc()
    
    finally:
        # 停止监控并生成报告
        monitor.stop_monitoring()
        monitor.generate_report()
        
        # 清理内存
        print("\n清理内存...")
        gc.collect()
        if torch.cuda.is_available():
            torch.cuda.empty_cache()
        
        # 显示最终内存状态
        final_memory = psutil.virtual_memory()
        print(f"最终内存状态: {final_memory.used / (1024**3):.1f}GB 使用中")

if __name__ == "__main__":
    main()

3.结果信息

➜  hxtest python3 100memory.py
============================================================
RTX 3090 复杂模型训练与内存监控程序
============================================================
使用设备: NVIDIA GeForce RTX 3090
GPU内存: 23.7GB
内存监控已启动...

==================================================
阶段1: CPU内存分配
==================================================

开始分配内存,目标: 100GB
内存使用: 23.5GB/503.5GB (5.3%) | GPU内存: 0MB已分配: 0.4GB | 当前总内存: 23.4GB
内存使用: 24.4GB/503.5GB (5.5%) | GPU内存: 0MB已分配: 0.7GB | 当前总内存: 23.8GB
内存使用: 24.6GB/503.5GB (5.5%) | GPU内存: 0MB已分配: 1.1GB | 当前总内存: 24.2GB
内存使用: 24.9GB/503.5GB (5.6%) | GPU内存: 0MB已分配: 1.5GB | 当前总内存: 24.5GB
内存使用: 25.1GB/503.5GB (5.7%) | GPU内存: 0MB已分配: 1.9GB | 当前总内存: 24.9GB
内存使用: 25.4GB/503.5GB (5.7%) | GPU内存: 0MB已分配: 2.2GB | 当前总内存: 25.3GB
内存使用: 25.7GB/503.5GB (5.8%) | GPU内存: 0MB已分配: 2.6GB | 当前总内存: 25.7GB
内存使用: 26.5GB/503.5GB (5.9%) | GPU内存: 0MB已分配: 3.0GB | 当前总内存: 26.0GB
内存使用: 26.8GB/503.5GB (6.0%) | GPU内存: 0MB已分配: 3.4GB | 当前总内存: 26.4GB
内存使用: 27.1GB/503.5GB (6.0%) | GPU内存: 0MB已分配: 3.7GB | 当前总内存: 26.8GB
内存使用: 27.4GB/503.5GB (6.1%) | GPU内存: 0MB已分配: 4.1GB | 当前总内存: 27.1GB
内存使用: 27.6GB/503.5GB (6.2%) | GPU内存: 0MB已分配: 4.5GB | 当前总内存: 27.5GB
内存使用: 28.6GB/503.5GB (6.3%) | GPU内存: 0MB已分配: 4.8GB | 当前总内存: 27.9GB
内存使用: 28.8GB/503.5GB (6.4%) | GPU内存: 0MB已分配: 5.2GB | 当前总内存: 28.3GB
内存使用: 29.0GB/503.5GB (6.4%) | GPU内存: 0MB已分配: 5.6GB | 当前总内存: 28.6GB
内存使用: 29.3GB/503.5GB (6.5%) | GPU内存: 0MB已分配: 6.0GB | 当前总内存: 29.0GB
内存使用: 29.6GB/503.5GB (6.5%) | GPU内存: 0MB已分配: 6.3GB | 当前总内存: 29.4GB
内存使用: 29.9GB/503.5GB (6.6%) | GPU内存: 0MB已分配: 6.7GB | 当前总内存: 29.8GB
内存使用: 30.8GB/503.5GB (6.8%) | GPU内存: 0MB已分配: 7.1GB | 当前总内存: 30.2GB
内存使用: 31.0GB/503.5GB (6.8%) | GPU内存: 0MB已分配: 7.5GB | 当前总内存: 30.5GB
内存使用: 31.2GB/503.5GB (6.9%) | GPU内存: 0MB已分配: 7.8GB | 当前总内存: 30.9GB
内存使用: 31.5GB/503.5GB (6.9%) | GPU内存: 0MB已分配: 8.2GB | 当前总内存: 31.2GB
内存使用: 31.6GB/503.5GB (6.9%) | GPU内存: 0MB已分配: 8.6GB | 当前总内存: 31.6GB
内存使用: 32.4GB/503.5GB (7.1%) | GPU内存: 0MB已分配: 8.9GB | 当前总内存: 31.9GB
内存使用: 33.1GB/503.5GB (7.2%) | GPU内存: 0MB已分配: 9.3GB | 当前总内存: 32.3GB
内存使用: 33.1GB/503.5GB (7.2%) | GPU内存: 0MB已分配: 9.7GB | 当前总内存: 32.7GB
内存使用: 33.8GB/503.5GB (7.4%) | GPU内存: 0MB已分配: 10.1GB | 当前总内存: 33.1GB
内存使用: 33.9GB/503.5GB (7.4%) | GPU内存: 0MB已分配: 10.4GB | 当前总内存: 33.5GB
内存使用: 34.5GB/503.5GB (7.5%) | GPU内存: 0MB已分配: 10.8GB | 当前总内存: 33.8GB
内存使用: 34.6GB/503.5GB (7.5%) | GPU内存: 0MB已分配: 11.2GB | 当前总内存: 34.2GB
内存使用: 35.3GB/503.5GB (7.7%) | GPU内存: 0MB已分配: 11.5GB | 当前总内存: 34.6GB
内存使用: 35.3GB/503.5GB (7.7%) | GPU内存: 0MB已分配: 11.9GB | 当前总内存: 35.0GB
内存使用: 35.9GB/503.5GB (7.8%) | GPU内存: 0MB已分配: 12.3GB | 当前总内存: 35.3GB
内存使用: 36.0GB/503.5GB (7.8%) | GPU内存: 0MB已分配: 12.7GB | 当前总内存: 35.7GB
内存使用: 36.2GB/503.5GB (7.8%) | GPU内存: 0MB已分配: 13.0GB | 当前总内存: 36.0GB
内存使用: 37.1GB/503.5GB (8.0%) | GPU内存: 0MB已分配: 13.4GB | 当前总内存: 36.5GB
内存使用: 37.3GB/503.5GB (8.1%) | GPU内存: 0MB已分配: 13.8GB | 当前总内存: 36.8GB
内存使用: 37.5GB/503.5GB (8.1%) | GPU内存: 0MB已分配: 14.2GB | 当前总内存: 37.2GB
内存使用: 37.8GB/503.5GB (8.2%) | GPU内存: 0MB已分配: 14.5GB | 当前总内存: 37.6GB
内存使用: 38.6GB/503.5GB (8.3%) | GPU内存: 0MB已分配: 14.9GB | 当前总内存: 37.9GB
内存使用: 38.9GB/503.5GB (8.4%) | GPU内存: 0MB已分配: 15.3GB | 当前总内存: 38.3GB
内存使用: 39.3GB/503.5GB (8.5%) | GPU内存: 0MB已分配: 15.6GB | 当前总内存: 38.6GB
内存使用: 39.8GB/503.5GB (8.6%) | GPU内存: 0MB已分配: 16.0GB | 当前总内存: 39.0GB
内存使用: 40.1GB/503.5GB (8.6%) | GPU内存: 0MB已分配: 16.4GB | 当前总内存: 39.4GB
内存使用: 40.4GB/503.5GB (8.7%) | GPU内存: 0MB已分配: 16.8GB | 当前总内存: 39.8GB
内存使用: 40.7GB/503.5GB (8.8%) | GPU内存: 0MB已分配: 17.1GB | 当前总内存: 40.1GB
内存使用: 41.1GB/503.5GB (8.8%) | GPU内存: 0MB已分配: 17.5GB | 当前总内存: 40.5GB
内存使用: 41.5GB/503.5GB (8.9%) | GPU内存: 0MB已分配: 17.9GB | 当前总内存: 40.9GB
内存使用: 41.8GB/503.5GB (9.0%) | GPU内存: 0MB已分配: 18.3GB | 当前总内存: 41.2GB
内存使用: 42.3GB/503.5GB (9.1%) | GPU内存: 0MB已分配: 18.6GB | 当前总内存: 41.6GB
内存使用: 42.7GB/503.5GB (9.1%) | GPU内存: 0MB已分配: 19.0GB | 当前总内存: 42.0GB
内存使用: 43.0GB/503.5GB (9.2%) | GPU内存: 0MB已分配: 19.4GB | 当前总内存: 42.4GB
内存使用: 43.4GB/503.5GB (9.3%) | GPU内存: 0MB已分配: 19.7GB | 当前总内存: 42.8GB
内存使用: 43.7GB/503.5GB (9.3%) | GPU内存: 0MB已分配: 20.1GB | 当前总内存: 43.1GB
内存使用: 44.1GB/503.5GB (9.4%) | GPU内存: 0MB已分配: 20.5GB | 当前总内存: 43.5GB
内存使用: 44.5GB/503.5GB (9.5%) | GPU内存: 0MB已分配: 20.9GB | 当前总内存: 43.9GB
内存使用: 44.9GB/503.5GB (9.6%) | GPU内存: 0MB已分配: 21.2GB | 当前总内存: 44.2GB
内存使用: 45.3GB/503.5GB (9.7%) | GPU内存: 0MB已分配: 21.6GB | 当前总内存: 44.6GB
内存使用: 45.7GB/503.5GB (9.7%) | GPU内存: 0MB已分配: 22.0GB | 当前总内存: 45.0GB
内存使用: 46.1GB/503.5GB (9.8%) | GPU内存: 0MB已分配: 22.4GB | 当前总内存: 45.4GB
内存使用: 46.4GB/503.5GB (9.9%) | GPU内存: 0MB已分配: 22.7GB | 当前总内存: 45.7GB
内存使用: 46.8GB/503.5GB (10.0%) | GPU内存: 0MB已分配: 23.1GB | 当前总内存: 46.1GB
内存使用: 47.2GB/503.5GB (10.0%) | GPU内存: 0MB已分配: 23.5GB | 当前总内存: 46.5GB
内存使用: 47.5GB/503.5GB (10.1%) | GPU内存: 0MB已分配: 23.8GB | 当前总内存: 46.8GB
内存使用: 47.9GB/503.5GB (10.2%) | GPU内存: 0MB已分配: 24.2GB | 当前总内存: 47.2GB
内存使用: 48.3GB/503.5GB (10.3%) | GPU内存: 0MB已分配: 24.6GB | 当前总内存: 47.6GB
内存使用: 48.7GB/503.5GB (10.3%) | GPU内存: 0MB已分配: 25.0GB | 当前总内存: 47.9GB
内存使用: 49.0GB/503.5GB (10.4%) | GPU内存: 0MB已分配: 25.3GB | 当前总内存: 48.3GB
内存使用: 49.4GB/503.5GB (10.5%) | GPU内存: 0MB已分配: 25.7GB | 当前总内存: 48.7GB
内存使用: 49.8GB/503.5GB (10.5%) | GPU内存: 0MB已分配: 26.1GB | 当前总内存: 49.1GB
内存使用: 50.1GB/503.5GB (10.6%) | GPU内存: 0MB已分配: 26.4GB | 当前总内存: 49.4GB
内存使用: 50.5GB/503.5GB (10.7%) | GPU内存: 0MB已分配: 26.8GB | 当前总内存: 49.8GB
内存使用: 51.0GB/503.5GB (10.8%) | GPU内存: 0MB已分配: 27.2GB | 当前总内存: 50.2GB
内存使用: 51.3GB/503.5GB (10.8%) | GPU内存: 0MB已分配: 27.6GB | 当前总内存: 50.6GB
内存使用: 51.7GB/503.5GB (10.9%) | GPU内存: 0MB已分配: 27.9GB | 当前总内存: 50.9GB
内存使用: 52.1GB/503.5GB (11.0%) | GPU内存: 0MB已分配: 28.3GB | 当前总内存: 51.3GB
内存使用: 52.4GB/503.5GB (11.1%) | GPU内存: 0MB已分配: 28.7GB | 当前总内存: 51.7GB
内存使用: 52.8GB/503.5GB (11.1%) | GPU内存: 0MB已分配: 29.1GB | 当前总内存: 52.1GB
内存使用: 53.1GB/503.5GB (11.2%) | GPU内存: 0MB已分配: 29.4GB | 当前总内存: 52.4GB
内存使用: 53.5GB/503.5GB (11.3%) | GPU内存: 0MB已分配: 29.8GB | 当前总内存: 52.8GB
内存使用: 53.9GB/503.5GB (11.4%) | GPU内存: 0MB已分配: 30.2GB | 当前总内存: 53.1GB
内存使用: 54.3GB/503.5GB (11.4%) | GPU内存: 0MB已分配: 30.5GB | 当前总内存: 53.5GB
内存使用: 54.6GB/503.5GB (11.5%) | GPU内存: 0MB已分配: 30.9GB | 当前总内存: 53.9GB
内存使用: 55.0GB/503.5GB (11.6%) | GPU内存: 0MB已分配: 31.3GB | 当前总内存: 54.3GB
内存使用: 55.4GB/503.5GB (11.7%) | GPU内存: 0MB已分配: 31.7GB | 当前总内存: 54.6GB
内存使用: 55.8GB/503.5GB (11.7%) | GPU内存: 0MB已分配: 32.0GB | 当前总内存: 55.0GB
内存使用: 56.1GB/503.5GB (11.8%) | GPU内存: 0MB已分配: 32.4GB | 当前总内存: 55.4GB
内存使用: 56.5GB/503.5GB (11.9%) | GPU内存: 0MB已分配: 32.8GB | 当前总内存: 55.7GB
内存使用: 56.9GB/503.5GB (12.0%) | GPU内存: 0MB已分配: 33.2GB | 当前总内存: 56.1GB
内存使用: 57.2GB/503.5GB (12.0%) | GPU内存: 0MB已分配: 33.5GB | 当前总内存: 56.5GB
内存使用: 57.6GB/503.5GB (12.1%) | GPU内存: 0MB已分配: 33.9GB | 当前总内存: 56.9GB
内存使用: 57.9GB/503.5GB (12.2%) | GPU内存: 0MB已分配: 34.3GB | 当前总内存: 57.2GB
内存使用: 58.1GB/503.5GB (12.2%) | GPU内存: 0MB已分配: 34.6GB | 当前总内存: 57.6GB
内存使用: 58.6GB/503.5GB (12.3%) | GPU内存: 0MB已分配: 35.0GB | 当前总内存: 58.0GB
内存使用: 59.0GB/503.5GB (12.4%) | GPU内存: 0MB已分配: 35.4GB | 当前总内存: 58.4GB
内存使用: 59.3GB/503.5GB (12.4%) | GPU内存: 0MB已分配: 35.8GB | 当前总内存: 58.7GB
内存使用: 59.8GB/503.5GB (12.5%) | GPU内存: 0MB已分配: 36.1GB | 当前总内存: 59.1GB
内存使用: 60.2GB/503.5GB (12.6%) | GPU内存: 0MB已分配: 36.5GB | 当前总内存: 59.5GB
内存使用: 60.6GB/503.5GB (12.7%) | GPU内存: 0MB已分配: 36.9GB | 当前总内存: 59.9GB
内存使用: 60.9GB/503.5GB (12.8%) | GPU内存: 0MB已分配: 37.3GB | 当前总内存: 60.2GB
内存使用: 61.3GB/503.5GB (12.8%) | GPU内存: 0MB已分配: 37.6GB | 当前总内存: 60.6GB
内存使用: 61.7GB/503.5GB (12.9%) | GPU内存: 0MB已分配: 38.0GB | 当前总内存: 61.0GB
内存使用: 62.0GB/503.5GB (13.0%) | GPU内存: 0MB已分配: 38.4GB | 当前总内存: 61.3GB
内存使用: 62.2GB/503.5GB (13.0%) | GPU内存: 0MB已分配: 38.7GB | 当前总内存: 61.7GB
内存使用: 62.5GB/503.5GB (13.1%) | GPU内存: 0MB已分配: 39.1GB | 当前总内存: 62.1GB
内存使用: 63.1GB/503.5GB (13.2%) | GPU内存: 0MB已分配: 39.5GB | 当前总内存: 62.5GB
内存使用: 63.5GB/503.5GB (13.3%) | GPU内存: 0MB已分配: 39.9GB | 当前总内存: 62.8GB
内存使用: 63.9GB/503.5GB (13.3%) | GPU内存: 0MB已分配: 40.2GB | 当前总内存: 63.2GB
内存使用: 64.3GB/503.5GB (13.4%) | GPU内存: 0MB已分配: 40.6GB | 当前总内存: 63.6GB
内存使用: 64.6GB/503.5GB (13.5%) | GPU内存: 0MB已分配: 41.0GB | 当前总内存: 63.9GB
内存使用: 64.7GB/503.5GB (13.5%) | GPU内存: 0MB已分配: 41.4GB | 当前总内存: 64.3GB
内存使用: 65.4GB/503.5GB (13.6%) | GPU内存: 0MB已分配: 41.7GB | 当前总内存: 64.6GB
内存使用: 65.4GB/503.5GB (13.7%) | GPU内存: 0MB已分配: 42.1GB | 当前总内存: 65.0GB
内存使用: 66.1GB/503.5GB (13.8%) | GPU内存: 0MB已分配: 42.5GB | 当前总内存: 65.4GB
内存使用: 66.4GB/503.5GB (13.8%) | GPU内存: 0MB已分配: 42.8GB | 当前总内存: 65.8GB
内存使用: 66.5GB/503.5GB (13.9%) | GPU内存: 0MB已分配: 43.2GB | 当前总内存: 66.2GB
内存使用: 66.8GB/503.5GB (13.9%) | GPU内存: 0MB已分配: 43.6GB | 当前总内存: 66.6GB
内存使用: 67.2GB/503.5GB (14.0%) | GPU内存: 0MB已分配: 44.0GB | 当前总内存: 66.9GB
内存使用: 67.8GB/503.5GB (14.1%) | GPU内存: 0MB已分配: 44.3GB | 当前总内存: 67.2GB
内存使用: 68.2GB/503.5GB (14.2%) | GPU内存: 0MB已分配: 44.7GB | 当前总内存: 67.6GB
内存使用: 68.3GB/503.5GB (14.2%) | GPU内存: 0MB已分配: 45.1GB | 当前总内存: 68.0GB
内存使用: 68.9GB/503.5GB (14.4%) | GPU内存: 0MB已分配: 45.4GB | 当前总内存: 68.3GB
内存使用: 69.0GB/503.5GB (14.4%) | GPU内存: 0MB已分配: 45.8GB | 当前总内存: 68.7GB
内存使用: 69.6GB/503.5GB (14.5%) | GPU内存: 0MB已分配: 46.2GB | 当前总内存: 69.1GB
内存使用: 70.0GB/503.5GB (14.6%) | GPU内存: 0MB已分配: 46.6GB | 当前总内存: 69.5GB
内存使用: 70.4GB/503.5GB (14.6%) | GPU内存: 0MB已分配: 46.9GB | 当前总内存: 69.8GB
内存使用: 70.9GB/503.5GB (14.7%) | GPU内存: 0MB已分配: 47.3GB | 当前总内存: 70.2GB
内存使用: 71.0GB/503.5GB (14.8%) | GPU内存: 0MB已分配: 47.7GB | 当前总内存: 70.6GB
内存使用: 71.6GB/503.5GB (14.9%) | GPU内存: 0MB已分配: 48.1GB | 当前总内存: 71.0GB
内存使用: 72.1GB/503.5GB (15.0%) | GPU内存: 0MB已分配: 48.4GB | 当前总内存: 71.3GB
内存使用: 72.3GB/503.5GB (15.0%) | GPU内存: 0MB已分配: 48.8GB | 当前总内存: 71.7GB
内存使用: 72.8GB/503.5GB (15.1%) | GPU内存: 0MB已分配: 49.2GB | 当前总内存: 72.0GB
内存使用: 72.8GB/503.5GB (15.1%) | GPU内存: 0MB已分配: 49.5GB | 当前总内存: 72.4GB
内存使用: 73.5GB/503.5GB (15.3%) | GPU内存: 0MB已分配: 49.9GB | 当前总内存: 72.8GB
内存使用: 73.9GB/503.5GB (15.3%) | GPU内存: 0MB已分配: 50.3GB | 当前总内存: 73.1GB
内存使用: 74.0GB/503.5GB (15.4%) | GPU内存: 0MB已分配: 50.7GB | 当前总内存: 73.5GB
内存使用: 74.5GB/503.5GB (15.5%) | GPU内存: 0MB已分配: 51.0GB | 当前总内存: 73.9GB
内存使用: 75.0GB/503.5GB (15.5%) | GPU内存: 0MB已分配: 51.4GB | 当前总内存: 74.3GB
内存使用: 75.3GB/503.5GB (15.6%) | GPU内存: 0MB已分配: 51.8GB | 当前总内存: 74.6GB
内存使用: 75.4GB/503.5GB (15.6%) | GPU内存: 0MB已分配: 52.2GB | 当前总内存: 75.0GB
内存使用: 76.0GB/503.5GB (15.8%) | GPU内存: 0MB已分配: 52.5GB | 当前总内存: 75.4GB
内存使用: 76.1GB/503.5GB (15.8%) | GPU内存: 0MB已分配: 52.9GB | 当前总内存: 75.8GB
内存使用: 76.4GB/503.5GB (15.8%) | GPU内存: 0MB已分配: 53.3GB | 当前总内存: 76.1GB
内存使用: 76.9GB/503.5GB (15.9%) | GPU内存: 0MB已分配: 53.6GB | 当前总内存: 76.5GB
内存使用: 77.4GB/503.5GB (16.0%) | GPU内存: 0MB已分配: 54.0GB | 当前总内存: 76.9GB
内存使用: 77.8GB/503.5GB (16.1%) | GPU内存: 0MB已分配: 54.4GB | 当前总内存: 77.2GB
内存使用: 78.1GB/503.5GB (16.2%) | GPU内存: 0MB已分配: 54.8GB | 当前总内存: 77.6GB
内存使用: 78.2GB/503.5GB (16.2%) | GPU内存: 0MB已分配: 55.1GB | 当前总内存: 78.0GB
内存使用: 78.8GB/503.5GB (16.3%) | GPU内存: 0MB已分配: 55.5GB | 当前总内存: 78.3GB
内存使用: 79.2GB/503.5GB (16.4%) | GPU内存: 0MB已分配: 55.9GB | 当前总内存: 78.7GB
内存使用: 79.7GB/503.5GB (16.5%) | GPU内存: 0MB已分配: 56.3GB | 当前总内存: 79.1GB
内存使用: 80.1GB/503.5GB (16.6%) | GPU内存: 0MB已分配: 56.6GB | 当前总内存: 79.5GB
内存使用: 80.5GB/503.5GB (16.6%) | GPU内存: 0MB已分配: 57.0GB | 当前总内存: 79.8GB
内存使用: 80.6GB/503.5GB (16.7%) | GPU内存: 0MB已分配: 57.4GB | 当前总内存: 80.2GB
内存使用: 81.2GB/503.5GB (16.8%) | GPU内存: 0MB已分配: 57.7GB | 当前总内存: 80.5GB
内存使用: 81.4GB/503.5GB (16.8%) | GPU内存: 0MB已分配: 58.1GB | 当前总内存: 80.9GB
内存使用: 82.0GB/503.5GB (16.9%) | GPU内存: 0MB已分配: 58.5GB | 当前总内存: 81.3GB
内存使用: 82.3GB/503.5GB (17.0%) | GPU内存: 0MB已分配: 58.9GB | 当前总内存: 81.6GB
内存使用: 82.3GB/503.5GB (17.0%) | GPU内存: 0MB[3]    2774 killed     python3 100memory.py
➜  hxtest

个人使用的 docker 镜像  内存不到100gb   

当前总内存: 81.6GB

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐