How to use external gpu on VisionFive v2

Hi bro, I just enabled the radeon module in the kernel, but I had to download firmware files from the console first while the card was plugged in, and then put them in the right places, also I had to rename files in /lib/firmware/SomeFolders for it to match depending on DMESG message logs. Then it worked by itself, I could get GUI, not just console :slight_smile:

1 Like

That’s great to hear! I’ll have to do some experimentation then… also, have you seen whether the card can work for ffmpeg video accelerated encoding? I am considering seeing whether I could compile it that way so I could use it for better encoding (if it’s hard to get H.264 encode working on the onboard GPU especially).

2 Likes

Sorry, no I didn’t try ffmpeg encoding yet.

Regarding the Mesa packages — can you be more specific? I have been trying to get my Radeon HD 7450 running and need the AMD firmware, but firmware-amd-graphics doesn’t seem to be available. Should I just copy the firmware files (in my case radeon/CAICOS_pfp.bin) from another system? (Not sure if they’re arch-specific).

Edit: Nevermind, just ran the following to grab the firmware:

git clone --depth 1 --filter=blob:none --sparse https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
cd linux-firmware
git sparse-checkout set radeon
sudo cp -R radeon /lib/firmware

Just wondering, since I’ve never set this up… did you follow these instructions or something like user-mode linux?

From the JH7110 datasheet the VPU hardware supports H.265 encoding 1080p@30fps, the JH7100 on the VisionFive 1 supports both. The VisionFive 2 does not have the hardware to support H.264 encoding.

This block diagram of the multimedia features confused me, until I realised that the same block diagram was used for both SoC’s.

There are example commands of video encoding using the custom starfive build of ffmpeg but some of the commands still mention h264 in this documentation, which at a guess is because some of the information in that document was migrated from the VisionFive 1 board.

When it comes to video encoding, the JH7100 must have licensed more expensive IP for the VPU than the JH7110. Form the two chips datasheets:

JH7100: Video Decoder(H264/H265): up to 1 channel 4K@60fps or 8 channel 1080p30fps
JH7100: Video Encoder(H264/H265): up to 1 channel 4K@60fps or 8 channel 1080p30fps

JH7110: Video Decoder(H264/H265): up to 1 channel 4K@60fps or 8-channel 1080p30fps
JH7110: Video Encoder(H265): 1080p@30fps

The GPU (IMG BXE-4-32 mc1) does not naively support video encoding, and if someone did write code for it to do so, I’m guessing that it would be really really really slow.

Video encoding/decoding happens in dedicated VPU blocks inside the SoC:
JH7110: Chips and Media WAVE420L IP (encode)
JH7110: Chips and Media WAVE511 IP (decode)
JH7100: Chips and Media WAVE521 IP (encode)
JH7100: Chips and Media WAVE511 IP (decode)

In my mind the future will be AV1 for computers and streaming services and H.266 for satellite and terrestrial TV services.

1 Like

I have my Radeon HD 7470 working, and I get console output, but after boot it starts flashing the screen and over and over I get these logs for like a minute:

[  144.420246] Allocated coherent memory, vaddr: 0xFFFFFFE1F97BAB60, paddr: 0x8010C000
[  144.427903] ====> vs_gem_alloc_buf, 162.vs_obj->get_pages = 0
[  145.648363] PVR_K:  1035: X disconnected - (devID = 0)
[  145.946836] vs_gem_dumb_create size = 1000
[  145.950986] Allocated coherent memory, vaddr: 0xFFFFFFE1FB3FF388, paddr: 0x10149F000
[  145.958755] ====> vs_gem_alloc_buf, 162.vs_obj->get_pages = 0
[  146.008825] PVR_K:  1044: X connected - (devID = 0)
[  146.362182] vs_gem_dumb_create size = 300000
[  146.368724] Allocated coherent memory, vaddr: 0xFFFFFFE1F97BE0C0, paddr: 0x80200000
[  146.376446] ====> vs_gem_alloc_buf, 162.vs_obj->get_pages = 0
[  146.395626] vs_gem_dumb_create size = 4000
[  146.399871] Allocated coherent memory, vaddr: 0xFFFFFFE1F97BAA80, paddr: 0x80108000
[  146.407528] ====> vs_gem_alloc_buf, 162.vs_obj->get_pages = 0
[  146.413293] vs_gem_dumb_create size = 4000
[  146.417462] Allocated coherent memory, vaddr: 0xFFFFFFE1F97BAB60, paddr: 0x8010C000
[  146.425137] ====> vs_gem_alloc_buf, 162.vs_obj->get_pages = 0
[  147.626145] PVR_K:  1044: X disconnected - (devID = 0)

It seems to be the PVR GPU driver conflict mentioned earlier. I can’t seem to use the console display with keyboard and mouse—only the internal HDMI port with its much slower performance (and no support for OpenGL it seems right now).

AV1 software support could be made that uses the cpu/gpu to make it happen.
In fact, I’m certain there are packages already built for this for the cpu, albeit not the fastest as you mentioned, it still already exists.

GPU support for AV1 yet? I don’t know if anybody has invested effort here. If it did, it wouldn’t be so slow.

Most limiting factor at hand for the VF2 is the pcie 2.0 with access to only one lane for storage. That really slows everything down with respect to processing data everywhere because data wants to be stored.

I think there will need to be an VF3 sooner rather than later with better/more recent pcie storage. Consumers of course would pay for this. The form-factor is what’s most attractive. The power envelope to support pcie3/4/5 and the attached devices is the big question mark. It would also require reflection how the SBC case would be made to handle all such attached devices for pcie3/4/5. Even USB needs faster pcie 3/4/5 and the question of power usage would need to be clearly answered as well.

All these subtleties are that the VF2 capabilities are honestly compared to what users usual requirements which are the average desktop/laptop, but in a mini-pc form factor.

When you add up all the little accessories one buys to make the VF2 work, it adds up to a intel x86_64 mini-pc’s cost or a used x86_64 laptop. Yet even a used x86_64 mini-pc/laptop still provides more capability than the VF2 to be quite honest. One needs to be truly dedicated to the fruition of the riscv ecosystem to commit to using VF2 hardware at the moment.

One should not be needing to be dedicated to use such hardware. Rather the hardware should be designed to compete with and exceed the users’ requirements/expectations and the consumers will be willing to pay for that.

It’s a lot like that movie “Field of Dreams”, “Build it and they will come.” X-window had a spin-off saying as well when it surfaced: “Build the software and the hardware will come.” Hifive unmatched has met a great deal of the requirements since they have a board that supports more recent pcie, but the core count is still very low considering the price of the hifive unmatched is 7 to 10 times the price of the VF2, but the core for the Hifive unmatched is the price of a mid-range pc that has more cores available.

Are there plans to offer a new Vision Five board that has more cores, newer pcie, more powerful gpu equivalent to a professional workstation?
Why? Because to be taken seriously, we need something that can provide for the required workstation tasks. All users have different requirements, but by the existence of gaming desktops, graphics/engineering workstations and such in x86_64 land, it should nudge Starfive to consider offering matching features at a matching price point to be taken more seriously.

I’m honest when I say VF2 at present is still very much a toy. I wish it were more than that.
It has the potential to be much more than that. I mean this in a good way. I am a backer after all. I would back another more powerful version of the VisionFive that would match and exceed high-end graphics workstations. I certainly can’t even recommend this as a replacement for an existing graphics workstation when I would like to, but I can’t because I would be laughed out of the room with the VF2’s existing capabilities compared to AMD’s/Intel’s latest x86_64 offerings and price points.

For the next version of Starfive VisionFive, make a survey and ask consumers what they really want. Let the consumers make the decisions as to the hardware specs.

 # ./target/release/freshfetch

  
                   ..                   blah@blahcantsay
                 .PLTJ.
                <><><><>                OS: CentOS Linux 7 (Core) x86_64
       KKSSV' 4KKK LJ KKKL.'VSSKK       Host: HP Z4 G4 Workstation
       KKV' 4KKKKK LJ KKKKAL 'VKK       Kernel: Linux 3.10.0-1160.81.1.el7.x86_64
       V' ' 'VKKKK LJ KKKKV' ' 'V       Uptime: 4 days, 18 hours, 56 minutes
       .4MA.' 'VKK LJ KKV' '.4Mb.       Packages: 1697 (rpm)
     . KKKKKA.' 'V LJ V' '.4KKKKK .     Shell: bash 
   .4D KKKKKKKA.'' LJ ''.4KKKKKKK FA.   Resolution: 1920x1080
  <QDD ++++++++++++  ++++++++++++ GFD>  CPU: Intel Core i9-10980XE  @ 3.00GHz (36) @ 4.8GHz
   'VD KKKKKKKK'.. LJ ..'KKKKKKKK FV    Board: HP 81C5
     ' VKKKKK'. .4 LJ K. .'KKKKKV '     Memory: 2692MB / 131639MB
        'VK'. .4KK LJ KKA. .'KV'
       A. . .4KKKK LJ KKKKA. . .4                               
       KKA. 'KKKKK LJ KKKKK' .4KK                               
       KKSSA. VKKK LJ KKKV .4SSKK
                <><><><>
                 'MKKM'
                   ''

PCIE 3.0 CPU/Motherboard I just got last week. it has lots of cores, lots of RAM, but honestly the pcie 3.0 was a savings measure and I have no decision making power to buy the hardware. Both AMD/Intel offer PCIE 5.0 CPU’s and motherboards along with Supermicro. If it were up to me, I would go pcie5.0 with as many lanes in the cpu/gpu/storage as possible. That’s what Starfive should be aiming for.

Why are we still talking PCIE 2 on a new RISC-V CPU and only offering one pcie lane to get to the storage and graphics? Starfive please offer something much better on the next SBC.

2 Likes

I heard that JH8100 might have pcie3.0x8, if that’s true, it would be interesting.(Though there might be some PHY sharing between other peripherals)

2 Likes

Hi Bro,Can you share the steps?
I rebuild the kernel source code,but the display-monitor is not lit up.I’m sure the radeon module is M and firmwares are also loaded in menuconfig.