This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] TDA4VL-Q1: How do I update the GPU driver on TDA4x devices?

Part Number: TDA4VL-Q1

I need to upgrade the GPU driver as there are bug fixes and new features available in the latest release. How can I upgrade the driver in my system?

  • GPU Driver Update Instructions

    The GPU driver is composed of two parts: user-mode libraries/driver (UM) and kernel-mode (KM) driver. The UM is closed-source, meaning we do not release the source code publicly. The KM is open-source, meaning we have it available in our SDK or on our public repositories. In order to install each on the system, different steps need to be taken.

    UM Libraries Installation

    The UM libraries are a collection of pre-built files which we package on our public facing "umlibs" public repository: https://git.ti.com/cgit/graphics/ti-img-rogue-umlibs/

    These libraries are prebuilt for each of our releases, and the build system will add these to the generated filesystem. Users can also update their filesystem by manually copying these libraries, which are already in the correct file structure. The below command is used as reference, assuming you have your filesystem on an SD card that has the rootfs partition mounted at /media/user/rootfs:

    cd ti-img-rogue-umlibs
    sudo cp -av targetfs/j721e_linux/wayland/release/* /media/user/rootfs

    That's it! The GPU driver will hook into the initialization scripts and be loaded as the system boots up. Sometimes, the GPU KM driver needs to be "insmod"-ed manually. In this case, the details of the KM driver are provided below.

    KM Driver Installation

    The KM driver is provided in our SDK under the following directory: ti-processor-sdk-linux-j721s2-evm-08_06_01_02/board-support/extra-drivers/ti-img-rogue-driver-1.15.6133109

    It is also posted in our public repository here: https://git.ti.com/cgit/graphics/ti-img-rogue-driver/

    The build instructions can be extracted from our SDK build infrastructure, but will be added here for clarity. The environment variables, which can be set in your shell OR passed on the make command, are as follows:

    Env Variable Value Meaning
    ARCH arm64 Architecture of target CPU
    CROSS_COMPILE aarch64-none-linux-gnu- The cross compiler you are using
    KERNELDIR path Path to your Linux kernel source directory
    RGX_BVNC

    36.53.104.796 - j721s2 and j784s4

    22.104.208.318 - j721e

    Version of GPU to use
    BUILD release or debug Build profile to use
    PVR_BUILD_DIR <soc>_linux Which build directory to use within the driver, each SOC has it's own directory
    WINDOW_SYSTEM wayland Which window system to use, only wayland supported at this time

    With these variables set, the make command should work. You can build within the ti-img-rogue-driver-1.15.6133109/build/linux/j721e_linux in the SDK or the ti-img-rogue-driver/build/linux/j721e_linux if you manually cloned it.

    To install on your target filesystem, the SDK will run the following command from the create binary directory:

    directory: ti-processor-sdk-linux-j721s2-evm-08_06_01_02/board-support/extra-drivers/ti-img-rogue-driver-1.15.6133109/binary_j721s2_linux_wayland_release

    ti-processor-sdk-linux-j721s2-evm-08_06_01_02/board-support/extra-drivers/ti-img-rogue-driver-1.15.6133109/binary_j721s2_linux_wayland_release$ sudo ./install.sh --root /media/<username>/rootfs
    
    File system root is /media/a0226667/rootfs
    
    Installing PowerVR 'rogueddk_1.15@6133109 (release)' on /media/a0226667/rootfs
    
    Installing kernel components for architecture target_aarch64
    kernel_module pvrsrvkm.ko -> /lib/modules/5.10.162-g76b3e88d56/extra/pvrsrvkm.ko
    
    To complete install, please run the following on the target system:
    $ depmod
    $ ldconfig

    Post-Installation Steps

    Now that both UM and KM libraries are updated, you can boot your system. When you get to the Linux prompt, you will know if the libraries were auto-loaded if you run "dmesg | grep -i pvr" and see output as follows:

    root@j721s2-evm:~# dmesg | grep -i pvr                                                                                
    [    5.085836] pvrsrvkm: loading out-of-tree module taints kernel.
    [    5.222004] PVR_K:  189: Read BVNC 36.53.104.796 from HW device registers
    [    5.415963] PVR_K:  189: RGX Device registered BVNC 36.53.104.796 with 1 core in the system
    [    5.672381] [drm] Initialized pvr 1.15.6133109 20170530 for 4e20000000.gpu on minor 0
    [    9.168474] PVR_K:  274: RGX Firmware image 'rgx.fw.36.53.104.796' loaded
    [    9.186869] PVR_K:  274: Shader binary image 'rgx.sh.36.53.104.796' loaded

    Notice the "RGX Firmware image * loaded". This means the GPU has loaded it's controlling firmware

    If you want to sanity check that the GPU is running, run this unit-test application that is part of the GPU driver:

    root@j721s2-evm:~# rgx_compute_test 
    ------------------ RGX compute test -----------------
    ----------------------- Start -----------------------
    Call PVRSRVConnectionCreateDevice with a valid argument:
    Connecting to first (0) default pvr device
     OK
    Create dev var context:
     OK
    Looking up General heap handle
     OK
    Getting event object
     OK
    Creating robustness buffer
     OK
    Mapping robustness buffer
     OK
    Creating Compute Context
     OK
    Creating Buffer
    Creating DWord for CDM Event Object
     OK
     OK
    Create PDS Heap
     OK
    Create USC Heap
     OK
    Reset event object value
    Creating NOP instruction
    Creating Data Segment
    Creating Code Segment
    Write Kernel 0
    Creating Fence Data Segment
    Creating Code Segment
    Write Fence Kernel
    Write Terminate
    Call services to kick CDM
     OK
    Poll for CDM event object data
    Event object value: 0xa1b2c3d4
     OK
     OK
    Destroy Compute Context
     OK
    
    Total time: 1ms
    Disconnect from services:
     OK
    ------------------------ End ------------------------

    Now we are sure the GPU driver is running correctly. Further issues may result from applications trying to access a display, but that is a separate discussion. At this point we are sure that the GPU driver is up and running.