-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test GPU (ASRock Rack M2_VGA, based on SM750) #62
Comments
Other server vendors also build the same chip (SM750) into full PCIe cards, e.g. Sunix's VGA0419L PCI-E card. And in this video, a rep demos a USB version of the video card and a few other form factors. Finally, some commentary from Phoronix seems to indicate the early versions of the driver were a bit rough (but hopefully adequate for ARM64... we'll see!). |
I was hoping the card would leech power off the PCI-E bus but it looks like you have to use the included 4-pin molex to 3-pin jumper to power the board, otherwise it doesn't show up on the Pi at all. I'm using an external / separate PSU and it looks like it puts 5v on the outer pins and GND in the middle. Anyways, here's the deets:
|
So might need to expand the BAR. Good thing I don't see any IO BAR in there 😅 Anyways, that's all for now, I'm going to recompile the kernel later (maybe tomorrow, maybe next week) and add in the SM750 driver, and see where we end up from there. All using the 64-bit Pi OS beta for now. |
Enabled:
Cross-compiling on kernel rpi-5.10.y branch. |
Pi HUD? 🤔 |
I was just about to suggest this to "GPU" to you after seeing the LTT video about it, but you already have one lol. |
Reference for anyone who doesn't subscribe to LTT: THIS is a Graphics Card..?? (I wish I had a team of tech nuts who could do all the testing and script writing for me... just jelly :) |
Well that's annoying. After recompiling the kernel and booting with the VGA card powered up and plugged in, the Pi starts booting to the point where the display starts flashing the cursor... then completely freezes. Here's what that looks like: (That signal's coming through the HDMI port on the IO Board, not from the VGA output.) I've tried rebooting multiple times, but it always gets stuck a few seconds in and then there's no response from anything. If I turn off power to the VGA card, it boots just fine. |
I used Every single time it gets stuck around here:
So maybe something that's trying to initialize some graphics rendering (the Plymouth Boot Screen...). The annoying thing is there doesn't seem to be a separate driver for the SM750 so I can't just disable it using a modprobe blacklist. This could be the shortest test cycle ever—I can't yet think of anything else to try :/ |
Just noting that without the card powered up, when it boots, it hits that 'Show Plymouth Boot Screen' in the log, then the screen flashes to black, then the screen comes back, outputs some more startup data, then ends with:
So something in the Plymouth Boot Screen process seems to kinda explode when this card is active. |
Uninstalling plymouth in light of the fact that I don't see how to completely disable it otherwise (all the online guides assume you're using GRUB, but Pi OS does not):
|
Well, now it locks up completely at:
So at least it doesn't lock up at the Plymouth stage anymore :D |
I'm recompiling the kernel without |
Okay, so without that compiled in, the thing boots with the board powered up... and even better, with the updated kernel (which has the better BAR space mapping committed a few months ago), the registers all look good:
Going to do some testing and see what happens with X.org. |
Well, nothing. It only outputs over HDMI. |
Hmm... driver being worked on over here: https://gitlab.com/sudipm/sm750/-/tree/sm750/drivers/gpu/drm/sm750 (from 2 years ago, ha!). See: https://github.com/raspberrypi/linux/blob/rpi-5.10.y/drivers/staging/sm750fb/TODO I emailed one of the contacts listed in the driver docs... who knows if I'll get a response. |
So... I tried pulling the patch from that drm driver and popping it into the 5.10.y branch—but when I build I get:
So it looks like that driver may be built for an older kernel version and isn't compatible with the latest kernel :/ |
Looks like that change was in kernel 5.5—so maybe running the current stable kernel version (5.4) would let it work? It's worth a try... See DisplayLink/evdi#185 |
Yeah... so doing a few manual patches to that patch to try to make it compile leads to dozens more compile errors, so I'm going to drop trying to get it working on 5.10.y, and jump back to 5.4.y. |
With the patch in place, the kernel build on 5.4.y seemed to work. Copied it over to the Pi, rebooted and...
Have to adjust the BAR space manually on this old kernel. With 1 GB BAR space, getting:
...but nothing in dmesg mentioning SM750, nor anything out of the VGA output. So... how do I get Linux/RPi to recognize the card using the new driver? Maybe I have to manually load it in somehow? |
Oh... well... that's not right:
|
Ugh... I can't get these drivers to build for the life of me!
I think I may have to throw in the towel on this GPU as well. Why are all the [okay but not great] working drivers only written for Windows? |
Respect for even getting this far, I wouldn't have slightest idea where to start, and I sure wouldn't have tried that long. In the LTT video, he mentions it's using a Windows feature called WARP. And the Wikipedia article about WARP says it uses "just-in-time compilation to x86 machine code". Is it possible the driver is dependent on x86 instructions or something like that? I have no idea how the Linux driver for it works though. |
The thing is though, WARP is a DirectX feature, not a driver feature. |
Could you try disabling fbdev emulation? Since it crashes after udev, it could be the console trying to access the fbdev, which could lock up the whole pi if something doesn't work, like using 64bit writes. You'll have to add |
I added |
@Coreforge - Sadly, that seems to have not made any difference: udev-lockup.mov |
(I wish I was in a position to help out with some of this diagnosis) |
I opened an issue detailing this behaviour on raspberrypi/linux and got a response from a former Broadcom, now Raspberry Pi foundation engineer: raspberrypi/linux#4928 (comment) It seems to boil down to the fact that the PCIe root complex on the BCM2711 can only support aligned access up to 32bit. So remapping PCIe BARs as normal memory will never work properly. No one expects normal memory to have any alignment requirements. Thus a whole bunch of PCI drivers and also userspace software using those drivers will just not work on the Pi 4 without rewriting them to do only aligned accesses. That would be a huge amount of work though and not useful beyond just "making it work" on the Pi. |
It supports aligned accesses up to 32 bits. The linked comment has been amended. |
Ah, sorry for the confusion. I've now edited the comment to reflect that, thanks for bringing it up! |
I don't think anyone has the idea it would be work that would be mainlined at any point, but there are some use cases where a particular driver or device is useful to get working on the Pi — for example people running storage controllers for disk storage on the Pi using old HBA cards — so it's nice to know all the corner cases where just a few lines of modified code will fix it. I think for simpler graphics cards like SM750-based cards, it might be feasible to maintain a patch (especially considering the driver hasn't changed in years) that gives full or close to full functionality, for the few crazy people who want to use it (e.g. for adding more displays or using any of the 2D rendering built in). Heck, maybe some casino startup wants to start building Pi slot machines :D |
All right, so I managed to apply @TobleMiner's patch in this comment to the latest kernel source, and compile the kernel with I tried booting an image with the full Pi OS and window manager, but when it initialized (with one HDMI display in HDMI0 and VGA connected to the M2_VGA card), it seemed to lock up. Got further than usual though. I'm going to try just a console version. |
I don't think a window manager is fully working on any gpu yet. Instead of reflashing, just booting it up without the gpu and disabling graphical boot in raspi-config should be faster and has the same effect. |
@Coreforge - Heh, too late ;) I was also working on my build script a tiny bit. Before:
After:
Pardon the crusty display. The other one I have with VGA input is in use but will soon be rotated out of that position! |
I noticed the SM750 driver has a number of |
Working on a patch here: geerlingguy/linux#2 (so far it just has the fb console working as @TobleMiner had earlier). |
With just the patch from @TobleMiner I was getting a weird artifact after the blinking cursor in the console over VGA. I updated my patch (see link above) with a few more memset swaps, and it seems like those artifacts are gone. Going to try on X to see if I can get a desktop. |
Rebooting with X and the driver loaded results in the screen hanging at some point (prior to seeing any possible errors), so I added:
Then after boot, I ran:
Dmesg shows:
Though the VGA input on my display shows nothing. via SSH, I see:
(Note: Within X, I can see Module seems loaded:
|
I switched 'Boot' to "To CLI" in Raspberry Pi Configuration and rebooted. In CLI, After I did that, I tried
|
lol someone else with a similar issue gave up trying to get an SM501 working and swapped over to an Nvidia GT710. After reading this post on the SM710, I also tried Someone else was having a similar error when running tigervnc and had to append an |
Huh... same error but on a different GPU, the core inside the Rockchip RK3399, here: https://forum.armbian.com/topic/12985-potential-opp-issue-with-nanopi-m4v2/#comment-95405
|
Similar issue encountered on the rk356x, crashing in the same place. |
@PixlRainbow - That would make sense :( — though that issue seems more aligned with issue #4 on the Radeon 5450 (though related possibly here). |
Just as an FYI, I also tested with https://gist.github.com/Coreforge/91da3d410ec7eb0ef5bc8dee24b91359?permalink_comment_id=4134159#gistcomment-4134159 (a |
Going to mark this as closed/complete, as the card is working about as far as I think we can expect without SiliconMotion getting involved, ideally writing a DRM driver for it instead of the ancient FB code that's currently in the kernel. |
Is there a place to buy this card or a variant of this? Seems like a neat solution for lean graphics, and not only for the Raspberry Pi use case this issue solved. |
This is a fun one—it's definitely not the kind of GPU where people would ask "will it run Crysis", especially since a headline feature is 2D graphics acceleration (not even 3D yet!).
But the ASRock Rack M2_VGA is an M.2 form factor graphics card that sports a lone VGA port and 16MB (yeah, MB, not GB) of DDR graphics memory.
I doubt it will even be as fast as the built-in graphics on the Pi, but it would be interesting to see if it works. It uses the SiliconMotion SM750 graphics chip, which actually supports up to two DVI/HDMI/VGA displays, as well as two video inputs which can be overlaid on those outputs.
The chip is mostly known for being helpful in embedded or server graphics situations, and is not a 'powerhouse' by any means. Just a little utilitarian chip that sips less than 2W of power maximum (making it suitable for lower-power scenarios where you still need a display or two, but don't do gaming or ML/AI applications on it).
It seems like there's a mainline driver since a few years ago (SM750), and it would be interesting to see if it 'just works' (compared to the other cards). It seems like the chip itself uses BIOS (and was designed in 2012), so that gives me a little pause.
But the chip is simple enough and documented enough that I wonder if we could bring it up manually if the driver starts barfing on memory allocations like all the other GPUs I've tested have (AMD and Nvidia).
The text was updated successfully, but these errors were encountered: