Which current laptop is best suited to run PTB?

Authentication token:

PESZDYNL-2021922152741:b13ec6d5b1f345fa3de058c47f3a4343313ab1a92470a11252a45099ce1f07b6

Hi,

this question has been asked earlier but the answers might already be a bit outdated. Our lab would like to buy a new laptop computer for running visual stimulation experiments. Since linux Ubuntu seems to be the best solution, this would be the OS of our choice. Is there any current linux laptop model that is best suited to run PTB on? We are thinking of something in this direction, but are of course open to other recommendations in case these laptops are not well suited for Linux or PTB:

Lenovo IdeaPad5 15.6" FHD Premium Laptop 8-Core AMD Ryzen 7 4700U AMD Radeon RX Vega 7 16GB RAM DDR4 512GB M.2 NVMe SSD

Lenovo Thinkbook 14s Premium Business Ultrabook, Linux Mint, Intel Quad Core i5-8265U, 256B PCIe SSD, 16GB RAM, 14" FHD IPS 1920x1080, Radeon 540X 2GB Graphics

Most important to us is an excellent visual stimulation timing. We mostly present static pictures, but some experiments also contain short movie clips. Sound is currently not important. We use Cedrus response boxes and would like to use the Cedrus C-Pod to send TTL event markers to our Neuralynx depth electrode recording system. All stimuli would be presented on the laptop screen itself, so no second screen setup is currently needed. Luminance and color properties are also somewhat secondary but of course not unimportant.

Thanks for any advice and recommendations!

Best,
Jonathan

Hi Jonathan. The answers are likely the same. Linux is the right choice. Ubuntu 20.04.3-LTS is currently the distribution best tested and recommended for most use cases, although other similar distros might work as well – unsupported and untested in case of problems though.

Disclaimer:

Wrt. hardware, irrespective of operating system choice, I can only mostly guarantee that hardware works flawlessly with any given operating system version, that i have tested myself.

Given the minimal financial resources we have, because way too few labs contribute by buying community memberships with priority support, and therefore lack of money to buy and test new hardware, my tested hardware is usually multiple years behind the state of the art.

Atm. PTB on Linux is actively tested on a 11 years old MacBookPro 2010, a 4 years old MacBookPro 2017, a 3 years old Microsoft Surface Pro 6 from 2018, and a cheap > 3.5 years old ~500 Euros, AMD Ryzen 5 2400G PC from early 2018’ish. The test set for Windows is only the 3.5 year old PC and Surface Pro tablet. macOS Catalina is only tested on the MBP 2017.

Any other advise is just based on feedback i see here on the forum, or theoretical knowledge, or other 3rd party info from Google searches. That said, i’m pretty knowledgable about that, so i hope my advices is usually not too much off.

In principle any machine with Intel or AMD graphics should work well with Linux + Psychtoolbox, unless a Google search indicates specific problems. In general, buying not the very latest machine, but maybe >= 6-12 months old, will increase the chance of good hardware support in current Linux distributions out of the box. There are also companies which provide dedicated Linux laptops, so if you can buy from them and avoid machines with NVidia graphics, that would be a quite safe choice. Companies like Dell or i think Lenovo and others also have some dedicated Linux offerings.

For highest performance and best functionality, you’d want to get AMD, so your two proposed laptops already check that box. Both look suitable on paper for not too demanding use cases, and what you describe - static image presentation or short movies, no fancy special external displays / HDR monitors / special visual stimulators / VR applications / high resolution and framerate displays - falls into the category of not too demanding use cases.

That said, something that is not easy to judge is the quality of the laptop internal flat panel display wrt. color/contrast reproduction, pixel response time, viewing angle, glare etc. So if you need very precise timing, the limiting factor for your stated use cases wouldn’t be PTB/Linux or the graphics card, but the quality of the display.

Wrt. visual timing/timestamping, both Intel and AMD gpu’s under Linux provide the highest technically possible precision and reliability. Timestamps are almost microsecond accurate and frame accurate timing should be perfect, as long as you don’t overload the gpu with too much drawing or write highly suboptimal code in your script. This recent thread gives various tips for performance optimizations on underpowered gpu’s: Timing issues/Missed frames on Dell XPS13 Ubuntu 18.04

The timing/timestamps however always refer to when a new frame arrives at the input of the display panel controller. How well that translates into the actual timing of emitted light depends on the properties of the specific display panel, and only photodiode measurements or similar external hardware measurements can give certainty.

With the caveat that display quality of both laptops is unknown, I would probably recommend this machine for you, ie. the Lenovo IdeaPad5 15.6" FHD Premium Laptop 8-Core AMD Ryzen 7 4700U.

According to a Phoronix test under Ubuntu 20.04-LTS, the Lenovo IdeaPad5 with Ryzen 7 4700U seems to perform very well on Linux - i think this is literally the machine you proposed:

The hardware in this machine is also more modern than the one in the Lenovo Thinkbook 14s, and AMD processors + integrated gpu’s are currently considered much better price/performance than Intel. Especially on the graphics side.

However, both should be fine, at least on paper.

From what i’ve quickly read, the Cedrus C-Pos should be accessible via USB-Serialport emulation. Their sample Matlab code claims an awful 5-7 msecs precision, but it uses Matlab’s serial port functions, which i haven’t tested in a while, but in the past they had very inferior timing performance compared to PTB’s IOPort driver, so i’d guess rewriting that sample code to use IOPort might give better results. Unless ofc. this is a problem of the Cedrus device and firmware. In the past, Cedrus wasn’t great in that area, but 10 years have elapsed since my last tests, so maybe that is less of an issue now.

Hope the advice is useful,
-mario

[Time spent on support request: 2 hours - priority support contingent used up for this license.]

Thank you very much for this very detailed answer. That was helpful. I will look further into these options.

Jonathan

Hi,

Just a quick follow-up question. Can you recommend buying a MacBook Pro 16,1 (Intel chip) and run Ubuntu on it?

https://support.apple.com/kb/SP809?locale=en_US

From a PTB perspective, the hardware looks good to me. And it looks like Ubuntu is working on those models with some hardware issues that seem not too dramatic for our use case.

However, are any of those issues especially problematic for using PTB? In this case, I guess I would rather go with the suggested Lenovo.

Thanks again!

Jonathan

Absolutely not! Unless you feel you have too much time on your hands and want to spend it tinkering with the machine instead of working with it. Or too much money to give to a laptop with really bad price / performance ratio.

I do have a MBP 2017 under Ubuntu Linux, and it works well enough for my purposes, but it took me a week to tinker it into something sufficiently usable. Rinse wash repeat after each major OS upgrade. It’s not something i enjoy, and i’m a hacker which contributes to the Linux kernel and other components, not an everyday user. I wouldn’t buy it for Linux use, it is just what i have, because it was donated to me and we don’t have the funding to really buy machines. Money constrains everything we can do with PTB.

If you’d get Linux running well enough, PTB would happily run on the machine. The AMD gpu’s should be well working and modern, etc. But getting Linux running on a modern Mac - the about most hostile machine towards alternative operating systems imaginable - is really not what you want to do, unless you enjoy tinkering a lot.

PTB will run happily on anything that is reported to work well with Linux. The only thing to consider for peace of mind is mostly to have an AMD or Intel gpu, not NVidia, if avoidable in any way. Also AMD graphics has advantages over Intel in performance and efficiency and price/performance atm. Also functional advantages if you need things like high color / contrast precision with more than 8 bpc framebuffers, HDR high dynamic range display support, or VRR support for fine-grained timing. I’ve added support for up to 12 bpc output to modern AMD graphics cards of Polaris and later recently, and expect that to become available for Psychtoolbox users very soon. We already have 10 bpc and 11 bpc output now with the latest Ubuntu 20.04.3-LTS. HDR support is there. VRR / FreeSync / Displayport adaptive sync is there, and PTB has a uniquely advanced implementation to achieve fine-grained timing in many use cases on such AMD setups. I’m working on experimental support for sub-millisecond timing as a side-project atm. But that will take a while, and has been set back again by probably at least a year due to lack of financial contributions by the user community. It will show up on AMD first though, once it is ready.

Intel is currently limited to 10 bpc for slightly older integrated gpu’s. For the more recent year 2019 and later Icelake (Intel Iris Pro) and Tigerlake (Intel Xe graphics) gpu’s, we are currently limited to good old 8 bpc framebuffers and display, due to some hardware/software challenges. Investigation is ongoing atm., unclear if this can be fixed soon or not. So for > 8 bpc color/luminance output one should stick to old Intel gpu’s atm., or choose AMD.

However, my understanding from the laptops you asked my opinion on, was that you don’t want to spend too much money on it, and that your needs are very basic. The Lenovo laptop should be fine, unless you deem the display unsuitable. Displays are certainly an area where a manufacturer may save money on cheaper offers, things like maximum brightness, color gamut, conrast etc. I think i read somewhere that that Lenovo has less then 60% sRGB coverage, which is mediocre, but i guess probably fine, unless you do color perception research.

If you want to spend more money on a Linux laptop that isn’t imho a Apple horror show, and probably has better displays than the Lenovo models for a higher price, i’d suggest looking at offerings, e.g., from Purism or Dell in the US, or Tuxedo in germany EU. Purism and Tuxedo are specifically Linux laptop manufacturers, well and Dell offers some of its Laptops with Ubuntu 20.04 preinstalled. I don’t have any practical experience with any of them, although my girlfriend just ordered a Laptop with AMD graphics from Tuxedo for her research use, so that will be interesting to evaluate.

Dell seems to also offer different display options for their Linux laptops from cheap to higher quality, e.g., the Dell-XPS 13 line. Certainly stuff that can match or exceed Apple laptops if we believe the specs. Even OLED displays, touchscreen, high brightness in the 400 - 500 nits range. Probably all for half the price of a MacBookPro 2019. Intel Iris Xe graphics though, so would be limited to 8 bpc and no HDR with PTB at the moment. But still 100% sRGB color gamut, and 90 - 100% DCI-P3 gamut.

Or you could combine a cheap laptop with a high quality external monitor. I think almost anything would run Linux + PTB better than modern Apple computers atm.

-mario

Thank you again for a very detailed response!! You certainly convinced me not to buy an Apple machine :slight_smile:

I saw the Dell XPS 13 line with pre-installed Ubuntu, too, but didn’t consider it further due to the Intel Iris graphics. But you are right, that might actually be a good option for us.

Thanks a lot!

Jonathan

It’s all about tradeoffs and what you expect to need for your paradigms.

With Intel you temporarily lose, compared to AMD: HDR display and greater than 10 bpc color / luminance display, and reliable support for more than two displays at a time. Until myself or somebody else gets around to implementing it, because these are currently software limitations. Which in my case is again mostly a matter of if our user community develops long-term thinking at some point and supports us financially or not. So far it doesn’t look good.

With modern Intel, the status of VRR is unknown, and may need work, due to lack of hardware to test this myself. Modern Intel Xe graphics should support it for suitable Displayport connected monitors, and it would certainly work for gaming use, but for PTB’s needs, it needs to pass a high bar wrt. timestamping, so may need some driver tweaks if it wouldn’t be perfect yet. My focus for this stuff is AMD atm., because i have the suitable hardware in my flat.

With modern Intel, you also lose 10 bpc color support, due to currently unclear hardware or software issues. X-Server 1.21 is currently in the making, which was supposed to bring this to modern Intel, but we ran into mysterious problems, so given the near deadline, this may not happen soon anymore. (For reference if one wants to see the development process at work: Xorg-server 21.0.99.2 crashes on intel Icelake and Tigerlake (#1193) · Issues · xorg / xserver, Try to fix gamma handling for GAMMA_LUT_SIZE > 1024. (!749) · Merge requests · xorg / xserver · GitLab, [TGL] GAMMA_LUT_SIZE and DEGAMMA_LUT_SIZE wrong (#3916) · Issues · drm / intel · GitLab).

But for the tasks you described, static images, image sequences, movies, no special needs for high precision display etc., 60 Hz on a flat-panel or similar, that should be easily doable, and the timing and timestamping mechanisms of PTB are the same for AMD and Intel, with an essentially perfect track record for both since over a decade. And a high quality, high brightness display also looks good at 8 bpc.

Another catch btw. is to not buy displays with a much higher resolution than needed: All this Retina / High-DPI stuff may look nice, but it also requires more performance from the graphics chip, system memory etc., so high resolutions can have a real impact on framerates or achievable workloads. Sometimes less, like 1920x1080 is more, compared to 4k monitors, depending on visual stimulus complexity, required framerates, etc. Again, all highly task dependent.

-mario