陳俊方
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # WSL安裝 Windows Subsystem for Linux ## 語法 docker start ``` $ sudo service docker restart $ service docker status ``` update ``` $ sudo apt-get update ``` root ``` $ sudo -s ``` Windows Ubuntu LTS path * C:\Users\A60610\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04LTS_79rhkp1fndgsc python ``` sudo apt-get install python-gi-dev ``` ## 安裝WSL 1. 更新 Windows 的 Nvidia 驅動程式 2. 【程式和功能】 啟動【Windows 子系統 Linux 版】與【虛擬機器平台】 [Windows 10 上跑 Ubuntu 18.04](https://https://medium.com/@misscoming/%E5%9C%A8-windows-10-%E4%B8%8A%E8%B7%91-ubuntu-18-04-92f80b2d725b) 4. 啟動虛擬機功能 [WSL:WslRegisterDistribution Error](https://https://hackmd.io/@withhhsong/WslRegisterDistributionError) 工作管理員 -->【模擬】 已啟用 5. 下載並安裝 Linux 核心更新套件 已安裝更高版本號 6. 設定 WSL CMD 輸入指令 `wsl --status` 即使顯示預設版本為 2 建議使用CMD指令再次指定為 2 `wsl --set-default-version 2` CMD查詢指令 `wsl --list --verbose` 8. 開啟【Microsoft Store】 Ubuntu 20.04.6 LTS 9. 設定使用者帳號與密碼? 每次開啟都是root 10. 可以在【Microsoft Store】 下載 Windows Terminal 往後開啟Ubuntu都用這個開啟, 可以使用文字複製貼上 ## 安裝 Docker ``` $sudo apt-get update $sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release ``` ``` $sudo mkdir -p /etc/apt/keyrings ``` ``` $curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg $echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ``` ``` $sudo apt-get update ``` ``` $sudo apt-get update $sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` ``` $ sudo usermod -aG docker $USER $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin $ sudo usermod -aG docker $USER ``` ``` $ sudo service docker restart $ service docker status ``` ## 安裝 Nvidia-Docker ``` $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) $ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - $ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list $ curl -s -L https://nvidia.github.io/libnvidia-container/experimental/$distribution/libnvidia-container-experimental.list | sudo tee /etc/apt/sources.list.d/libnvidia-container-experimental.list $ sudo apt-get update $ sudo apt-get install -y nvidia-container-toolkit $ sudo nvidia-ctk runtime configure --runtime=docker ``` ``` $ sudo service docker restart $ service docker status ``` 測試安裝結果-1 ``` $ sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi ``` 測試安裝結果-2 tensorflow ``` $ sudo docker run --runtime=nvidia --rm -it --name tensorflow-1.14.0 tensorflow/tensorflow:1.14.0-gpu-py3 ``` tensorflow ``` $ python $ import tensorflow as tf $ print(tf.test.is_gpu_available()) ``` ## 安裝NVIDIA NGC -- admin01 https://ngc.nvidia.com/setup/api-key 註冊/登入 (用google 帳號) nvdia##%%%% API Key: ``` $ docker login nvcr.io $ $oauthtoken dnA5aGRvdTMzb2hxYjdraTFrdjVlN2dmMGo6MmRiMTY0YzUtMzUyZi00YzE0LWI2YTEtZjZmZTI1YmY1OTRi ``` NGC 權限設定 x509--尚未解決 (工研院網路): ``` Error response from daemon: Get "https://nvcr.io/v2/": tls: failed to verify certificate: x509: certificate signed by unknown authority ``` 換成個人4G網路連線,則可成功 Login Succeede 下載映像檔(image) (下載有點久, 要下載20GB以上) ``` $ docker pull nvcr.io/nvidia/deepstream:6.2-devel $ docker pull nvcr.io/nvidia/deepstream:6.2-samples ``` 檔案大小約35GB ``` C:\Users\A60610\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04LTS_79rhkp1fndgsc\LocalStateLocalState\ext4.vhdx ``` ### 安裝 VNC SERVER ``` $ sudo service docker restart $ service docker status $ vncserver $ ifconfig $ vncserver -kill :1 ``` ``` $ sudo apt update && sudo apt upgrade Do you want to continue? [Y/n] y $ sudo apt install xfce4 xfce4-goodies Do you want to continue? [Y/n] y 安裝 xfce4 跳出選擇視窗,選 gdm3 (安裝很久) $ sudo apt install tightvncserver $ sudo apt install dbus-x11 $ sudo apt install net-tools ``` ``` $ vncserver You will require a password to access your desktops. Password: admin01 (密碼不能太短, 不給過) Verify: Would you like to enter a view-only password (y/n)? n 選項記得選輸入n xauth: file /root/.Xauthority does not exist New 'X' desktop is 52-0A60610-01:1 $ vncserver -kill :1 先停止 server 進行其他設定 Killing Xtightvnc process ID 22282 ``` Password: `admin01` (VNC 登入會用到) Linux vi 文字編輯器操作說明 https://www.tpisoftware.com/tpu/articleDetails/1578 先存檔再離開vi `:wq` 捨棄所有修改,強制離開vi `:qa!` 在 Ubuntu 20.04 中使用 VNC server https://yuxian0908.github.io/system/2020/09/18/Linux_Vnc_Server/ tightVNC with xfce 執行指令:`vncserver` New 'X' desktop is 52-0A60610-01:4 windows 安裝 VNC VIEWER WSL IP:`ifconfig` 172.25.253.78:5901 172.29.17.3:5905 查看進行遠端連線的 PID:`netstat -anp |grep tcp` tcp 0 0 0.0.0.0:5904 0.0.0.0:* LISTEN 591/Xtightvnc tcp 0 0 0.0.0.0:6004 0.0.0.0:* LISTEN 591/Xtightvnc 找到數字後可以直接 KILL,例如:`kill 12345` ``` $ xhost + access control disabled, clients can connect from any host ``` ### 執行 docker deepstream 啟動docker ``` $ sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -w /home/root/sample -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/deepstream:6.2-samples ``` 執行官網範例 ds_audio_sonyc_test_config ``` $ cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-audio/configs $ deepstream-audio -c ds_audio_sonyc_test_config.txt ``` # deepstream-audio Prerequisites Follow these procedures to use the deepstream-audio application for native compilation. You must have the following development packages installed GStreamer-1.0 GStreamer-1.0 Base Plugins GStreamer-1.0 gstrtspserver X11 client-side library To install these packages, execute the following command: (進入docker內安裝就不用加 sudo) ``` sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \ libgstrtspserver-1.0-dev libx11-dev libjson-glib-dev ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully