• 🥇 copyright: this article by [Moneo-ai] original, you big guy, one read, please refer to
  • 🎉 statement: as one of the bloggers in AI field, ❤️ lives up to your time and your ❤️
    • ❤️ deep learning model training foundation environment construction related tutorial ———— carefully help you sort out

    📘 View the graphics card usage of the server

    When you run a Python program from the command line

    • First to see which Gpus are idle, nviDIa-SMI displays the current GPU usage
    nvidia-smi
    Copy the code
    • As shown in the following figure, two graphics cards, numbered 0 and 1, are occupied by the same process PID 3016

    Basic graphic information

    GPU: indicates the GPU number. Name: GPU model. Persistence-m: State of persistent mode. The continuous mode consumes a lot of energy, but it takes less time to start a new GPU application, which is shown in the off state. Fan: The Fan speed ranges from 0 to 100%. Temp: indicates the temperature, in degrees Celsius. Perf: Indicates the performance status. The value ranges from P0 to P12. P0 indicates the maximum performance, and P12 indicates the minimum performance. Pwr:Usage/Cap: power consumption; Memory Usage: video Memory Usage; A: Display Active: indicates whether the Display of the GPU is initialized. Volatile GPU-util: floating GPU utilization; Volatile GPU-util: Volatile GPU utilization. ECC: Error Correcting Code; Compute M: Compute modeCopy the code

    📘 Specifies an idle GPU to run Python programs

    CUDA_VISIBLE_DEVICES = 0, 1 python test. PyCopy the code

    📘 Specify the GPU in a Python program (usually using this setting)

    At the top of train.py, set the GPU number to use. When these two lines are commented out, the training will automatically use all of the server’s resources

    import os
    os.environ["CUDA_VISIBLE_DEVICES"] = "0, 1"
    Copy the code

    Display GPU usage every 10s, CTRL + C in Xshell stop:

    watch -n 10 nvidia-smi
    Copy the code

    Refresh GPU usage every 2s, Xshell or CTRL + C stops in Shell window:

    nvidia-smi -l 2
    Copy the code

    📘 more effective tutorials

    The content of this blog is difficult to generalize, if there are inappropriate places, welcome to the comment area criticism and correction


    For those who are about to enter the line of computer vision, Murray here recommend the collection of dry goods blog is as follows

    • ❤️ deep learning model training foundation environment construction related tutorial ———— carefully help you sort out

    🚀🚀 Mexic AI


  • 🎉 as one of the bloggers with the most dry goods in the field of AI, ❤️ lives up to his time and qing ❤️
  • ❤️ If the article is helpful to you, like, comment encourage bloggers every minute to seriously create