Ubuntu-Safe-Graphic解決安裝時顯卡驅動問題

安裝Ubuntu如果遇到顯示卡驅動問題,可以選用Ubuntu safe graphic模式安裝,這樣就不會遇到顯卡驅動問題了。

Nvidia Driver安裝

使用Ubuntu driver管理器安裝(推薦)

https://ubuntu.com/server/docs/nvidia-drivers-installation

移除舊驅動

https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/#removing-nvidia-driver

1
2
sudo apt-get remove --purge -V "nvidia-driver*" "libxnvctrl*"
sudo apt-get autoremove --purge -V

手動停用nouveau driver
檢查nouveau有沒被載入
lsmod | grep nouveau

停用nouveau

1
2
3
4
5
6
7
8
cat <<EOF | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
EOF

sudo update-initramfs -u

sudo reboot

https://docs.nvidia.com/ai-enterprise/deployment/vmware/latest/nouveau.html#disable-nouveau

nouveau driver會自動被安裝程式停用,校啟用可以依照以下指示重新啟用。(可能會失敗)

1
2
One or more modprobe configuration files to disable Nouveau have been written.  You will need to reboot your system and possibly rebuild the initramfs before these changes can take effect.  Note if you later wish to reenable Nouveau, you will    
need to delete these files: /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf, /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

安裝驅動

https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/#frequently-asked-questions

https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html#install-nvidia-driver-535-183-06-for-data-center-gpus-and-560-35-03-for-rtx-gpus

類別之間的關係

在物件導向程式設計(OOP)中,類別(class)之間的關係可以分為以下幾種類型:


1. 繼承關係(Inheritance)

  • 描述:子類別繼承父類別的屬性和方法,並可以擴展或重寫這些方法。
  • 用途:表示「is-a」關係,子類別是一種父類別的特殊化。
  • 範例
    1
    2
    3
    4
    5
    6
    7
    class Animal:
    def speak(self):
    print("Animal speaks")

    class Dog(Animal): # Dog 繼承自 Animal
    def speak(self):
    print("Dog barks")

2. 組合關係(Composition)

  • 描述:一個類別包含另一個類別的實例,形成「has-a」關係。
  • 用途:用於表示部分-整體或擁有關係。
  • 範例
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    class Engine:
    def start(self):
    print("Engine starts")

    class Car:
    def __init__(self):
    self.engine = Engine() # Car 擁有一個 Engine 實例

    def drive(self):
    self.engine.start()
    print("Car is driving")

3. 關聯關係(Association)

  • 描述:一個類別和另一個類別之間有某種業務邏輯上的聯繫,但並不擁有對方的實例。
  • 用途:表示「使用」或「合作」的關係。
  • 範例
    1
    2
    3
    4
    5
    6
    7
    class Driver:
    def drive(self, car):
    car.drive()

    class Car:
    def drive(self):
    print("Car is being driven")

4. 聚合關係(Aggregation)

  • 描述:一個類別包含另一個類別的實例,但兩者是弱依賴的關係,子物件的生命周期獨立於父物件。
  • 用途:表示「部分-整體」的關係,但部分可以獨立存在。
  • 範例
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    class Wheel:
    def rotate(self):
    print("Wheel rotates")

    class Car:
    def __init__(self, wheels):
    self.wheels = wheels # Car 擁有 Wheels,但 Wheels 可以獨立存在

    def drive(self):
    for wheel in self.wheels:
    wheel.rotate()

5. 依賴關係(Dependency)

  • 描述:一個類別暫時依賴於另一個類別的功能,但不是永久的關聯。
  • 用途:通常用於方法或函數中的參數傳遞。
  • 範例
    1
    2
    3
    4
    5
    6
    7
    class Printer:
    def print_document(self, document):
    print(f"Printing: {document}")

    class User:
    def use_printer(self, printer):
    printer.print_document("MyDocument.pdf")

額外說明

  • 這些關係可以搭配使用,例如繼承 + 組合的模式經常出現在大型系統中。
  • 適當選擇關係有助於提升程式的可讀性、可重用性和維護性。

參考:
https://realpython.com/inheritance-composition-python/
Association,Aggregation,Composition and Inheritance的差異
https://itexpertsconsultant.wordpress.com/tag/class-diagram/
UML關係圖
https://www.visual-paradigm.com/guide/uml-unified-modeling-language/uml-class-diagram-tutorial/
https://www.umlboard.com/docs/relations/

帶寬測量工具iftop

查看不同網段以外的流量
``bash
sudo iftop -F 10.179.3.0/24


參考:


https://blog.csdn.net/qq_35995514/article/details/136542702

https://cloud.tencent.com/developer/article/1827834


https://www.alibabacloud.com/help/en/ecs/support/query-and-case-analysis-of-linux-network-traffic-load