Skip to content

Instantly share code, notes, and snippets.

@babldev
Last active May 12, 2025 23:23
Show Gist options
  • Select an option

  • Save babldev/ade0de11f4509a2804aea029bc60e67f to your computer and use it in GitHub Desktop.

Select an option

Save babldev/ade0de11f4509a2804aea029bc60e67f to your computer and use it in GitHub Desktop.

Revisions

  1. babldev revised this gist May 12, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -112,7 +112,7 @@ docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest
    cd build/
    cd tisdk/build/
    . conf/setenv
    ```

  2. babldev revised this gist May 12, 2025. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -104,7 +104,16 @@ Remount SSD:
    sudo mkdir -p /mnt/disks/ssd1
    sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
    export WORK_DIR=/mnt/disks/ssd1/yocto
    cd $WORK_DIR
    ```

    Restart TI Ubuntu docker image and enter:
    ```bash
    docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest
    cd build/
    . conf/setenv
    ```

    ## Rebuilding
  3. babldev revised this gist May 12, 2025. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -90,6 +90,23 @@ docker exec -it NAME_OF_CONTAINER /bin/bash
    screen -ARd
    ```

    ## Restoring stopped instance

    Start instance:
    ```bash
    gcloud beta compute instances start INSTANCE_NAME \
    --zone=ZONE
    gcloud compute ssh INSTANCE_NAME --zone=ZONE
    ```

    Remount SSD:
    ```sh
    sudo mkdir -p /mnt/disks/ssd1
    sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
    export WORK_DIR=/mnt/disks/ssd1/yocto
    cd $WORK_DIR
    ```

    ## Rebuilding

    Delete the existing `build/deploy-ti/` directory or you may get errors.
  4. babldev revised this gist May 12, 2025. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -90,6 +90,14 @@ docker exec -it NAME_OF_CONTAINER /bin/bash
    screen -ARd
    ```

    ## Rebuilding

    Delete the existing `build/deploy-ti/` directory or you may get errors.

    ```bash
    rm -rf build/deploy-ti/
    ```

    ## Speeding up builds

    ### Build limited images
  5. babldev revised this gist May 12, 2025. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@ Linux Ubuntu expects amd64 architecture.
    Build performance on `c3d-standard-8-lssd` (8 vCPU, 32 GB Memory, SSD)
    - ~10 hours (CPU bound)
    - Used 351GB (of 369GB SSD)
    - Final rootfs image is 1.1GB tar.gz

    Used 351 GB (of 369GB SSD).
    ```bash
    @@ -28,7 +29,7 @@ $ du --summarize --human-readable *
    504K src
    ```

    **Note:** The directories used across builds only tally to ~50GB. `downloads/` is only 28G and `build/sstate-cache/` is 19G.
    **Note:** The directories used across builds only tally to ~50GB. `downloads/` is only 28G and `build/sstate-cache/` is 19G. The majority of the space is used for the `build/arago-tmp-*` temp directories (300GB+).

    I chose [Google Container Optimized OS](https://cloud.google.com/container-optimized-os/docs) so Docker is pre-installed.

  6. babldev revised this gist May 12, 2025. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,25 @@ Build performance on `c3d-standard-8-lssd` (8 vCPU, 32 GB Memory, SSD)
    - ~10 hours (CPU bound)
    - Used 351GB (of 369GB SSD)

    Used 351 GB (of 369GB SSD).
    ```bash
    $ du --summarize --human-readable *
    4.0K README
    312K bitbake-setup
    323G build
    1.8M conf
    872K configs
    28G downloads
    4.0K git_retry.sh
    376K kas
    32K oe-layertool-setup.sh
    144K sample-files
    440M sources
    504K src
    ```

    **Note:** The directories used across builds only tally to ~50GB. `downloads/` is only 28G and `build/sstate-cache/` is 19G.

    I chose [Google Container Optimized OS](https://cloud.google.com/container-optimized-os/docs) so Docker is pre-installed.

    ## Instance bootstrap
  7. babldev revised this gist May 12, 2025. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,11 @@

    ## Instance type

    Linux Ubuntu expects amd64 architecture. I'm using a Google Cloud VM instance type `c3d-standard-8-lssd`.
    Linux Ubuntu expects amd64 architecture.

    Build performance on `c3d-standard-8-lssd` (8 vCPU, 32 GB Memory, SSD)
    - ~10 hours (CPU bound)
    - Used 351GB (of 369GB SSD)

    I chose [Google Container Optimized OS](https://cloud.google.com/container-optimized-os/docs) so Docker is pre-installed.

  8. babldev revised this gist May 12, 2025. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -60,6 +60,12 @@ Build full `tisdk-edgeai-image` SDK:
    MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image
    ```

    Reconnecting to Docker image screen instance (if disconnected):
    ```bash
    docker exec -it NAME_OF_CONTAINER /bin/bash
    screen -ARd
    ```

    ## Speeding up builds

    ### Build limited images
  9. babldev revised this gist May 11, 2025. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    # Google Cloud VM - TI Linux Yocto build
    # TI AM67A Linux SDK - Yocto build on Google Cloud Compute Engine

    - [AM67A Linux SDK Product page](https://www.ti.com/tool/PROCESSOR-SDK-AM67A)
    - [AM67A Linux SDK Docs](https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-am67a/latest/exports/docs/linux/Overview.html)

    ## Instance type

  10. babldev revised this gist May 11, 2025. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@

    Linux Ubuntu expects amd64 architecture. I'm using a Google Cloud VM instance type `c3d-standard-8-lssd`.

    I chose [Google Container Optimized OS](https://cloud.google.com/container-optimized-os/docs) so Docker is pre-installed.

    ## Instance bootstrap

    Mount SSD: [docs](https://cloud.google.com/compute/docs/disks/add-local-ssd#formatandmount)
    @@ -43,6 +45,13 @@ cd build
    echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf
    ```

    **Optional:** Use `screen` so you can reconnect to build if SSH connection is lost. Google Container OS does not allow package installs so you need to do this within Docker. Alternatively, use Ubuntu/Debian VM instead of the locked down Google Container OS.
    ```bash
    sudo apt update
    sudo apt install screen
    screen -ARd
    ```

    Build full `tisdk-edgeai-image` SDK:
    ```bash
    MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image
  11. babldev revised this gist May 11, 2025. No changes.
  12. babldev revised this gist May 11, 2025. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,7 @@

    ## Instance type

    Linux Ubuntu expects amd64 architecture. Using Google Cloud VM instance type `c3d-standard-8-lssd`.

    Builds are CPU bound so more vCPUs will reduce initial build time.
    Linux Ubuntu expects amd64 architecture. I'm using a Google Cloud VM instance type `c3d-standard-8-lssd`.

    ## Instance bootstrap

    @@ -60,4 +58,7 @@ The minimal `tisdk-bootstrap-image` will build faster than `tisdk-edgeai-image`.
    gcloud beta compute instances stop INSTANCE_NAME \
    --discard-local-ssd=false \
    --zone=ZONE
    ```
    ```

    ### Faster/more vCPUs
    Initial builds are CPU bound so adding vCPUs will reduce build time.
  13. babldev renamed this gist May 11, 2025. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion README.md → TI_SDK_YOCTO.md
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,19 @@ cd build
    echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf
    ```

    Build full SDK:
    Build full `tisdk-edgeai-image` SDK:
    ```bash
    MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image
    ```

    ## Speeding up builds

    ### Build limited images
    The minimal `tisdk-bootstrap-image` will build faster than `tisdk-edgeai-image`.

    ### Persist SSD storage on shutdown
    ```bash
    gcloud beta compute instances stop INSTANCE_NAME \
    --discard-local-ssd=false \
    --zone=ZONE
    ```
  14. babldev revised this gist May 11, 2025. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -2,13 +2,13 @@

    ## Instance type

    Using `c3d-standard-8-lssd`
    Linux Ubuntu expects amd64 architecture. Using Google Cloud VM instance type `c3d-standard-8-lssd`.

    https://cloud.google.com/compute/docs/disks/add-local-ssd#formatandmount
    Builds are CPU bound so more vCPUs will reduce initial build time.

    ## Instance bootstrap

    Mount SSD:
    Mount SSD: [docs](https://cloud.google.com/compute/docs/disks/add-local-ssd#formatandmount)
    ```bash
    sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/nvme1n1
    sudo mkdir -p /mnt/disks/ssd1
  15. babldev revised this gist May 11, 2025. 2 changed files with 48 additions and 21 deletions.
    48 changes: 48 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,51 @@
    # Google Cloud VM - TI Linux Yocto build

    ## Instance type

    Using `c3d-standard-8-lssd`

    https://cloud.google.com/compute/docs/disks/add-local-ssd#formatandmount

    ## Instance bootstrap

    Mount SSD:
    ```bash
    sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/nvme1n1
    sudo mkdir -p /mnt/disks/ssd1
    sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
    sudo chmod a+w /mnt/disks/ssd1/
    ```

    Create build directory:
    ```bash
    mkdir /mnt/disks/ssd1/yocto
    export WORK_DIR=/mnt/disks/ssd1/yocto
    ```

    Start TI Ubuntu:
    ```bash
    docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest
    ```

    Bootstrap SDK repo:
    ```bash
    sudo chown -R tisdk /home/tisdk
    git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
    cd tisdk/
    ```

    Bootstrap SDK build:
    ```bash
    ./oe-layertool-setup.sh -f configs/processor-sdk-analytics/processor-sdk-analytics-10.01.00-config.txt
    cd build
    . conf/setenv
    echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf
    ```

    Build full SDK:
    ```bash
    MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image
    ```
    21 changes: 0 additions & 21 deletions vm.sh
    Original file line number Diff line number Diff line change
    @@ -1,21 +0,0 @@
    sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/nvme1n1
    sudo mkdir -p /mnt/disks/ssd1
    sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
    sudo chmod a+w /mnt/disks/ssd1/
    mkdir /mnt/disks/ssd1/yocto

    export WORK_DIR=/mnt/disks/ssd1/yocto

    docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest

    sudo chown -R tisdk /home/tisdk
    git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
    cd tisdk/
    ./oe-layertool-setup.sh -f configs/processor-sdk-analytics/processor-sdk-analytics-10.01.00-config.txt
    cd build
    . conf/setenv
    echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf
    MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image
  16. babldev revised this gist May 11, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    Using `c3d-standard-8-lssd`

    https://cloud.google.com/compute/docs/disks/add-local-ssd#create_local_ssd
    https://cloud.google.com/compute/docs/disks/add-local-ssd#formatandmount
  17. babldev revised this gist May 11, 2025. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,3 @@
    Using `c3d-standard-8-lssd`
    Using `c3d-standard-8-lssd`

    https://cloud.google.com/compute/docs/disks/add-local-ssd#create_local_ssd
  18. babldev revised this gist May 11, 2025. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions vm.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/nvme1n1
    sudo mkdir -p /mnt/disks/ssd1
    sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/
    sudo chmod a+w /mnt/disks/ssd1/
    mkdir /mnt/disks/ssd1/yocto

    export WORK_DIR=/mnt/disks/ssd1/yocto

  19. babldev revised this gist May 11, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    Using `c4a-highmem-4-lssd`
    Using `c3d-standard-8-lssd`
  20. babldev revised this gist May 11, 2025. No changes.
  21. babldev revised this gist May 11, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Using `c4a-highmem-4-lssd`
  22. babldev created this gist May 11, 2025.
    18 changes: 18 additions & 0 deletions vm.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/nvme1n1
    sudo mount -o discard,defaults /dev/nvme1n1 /mnt/disks/ssd1/

    export WORK_DIR=/mnt/disks/ssd1/yocto

    docker run --privileged -it \
    -v ${WORK_DIR}:/home/tisdk \
    -w /home/tisdk \
    ghcr.io/texasinstruments/ubuntu-distro:latest

    sudo chown -R tisdk /home/tisdk
    git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
    cd tisdk/
    ./oe-layertool-setup.sh -f configs/processor-sdk-analytics/processor-sdk-analytics-10.01.00-config.txt
    cd build
    . conf/setenv
    echo 'ARAGO_BRAND = "edgeai"' >> conf/local.conf
    MACHINE="j722s-evm" bitbake -k tisdk-edgeai-image