<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mirza Bilal on Medium]]></title>
        <description><![CDATA[Stories by Mirza Bilal on Medium]]></description>
        <link>https://medium.com/@mirzabilals?source=rss-fb609e2b855------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Vt0na3bbpsXnGR5vdiHyLA.png</url>
            <title>Stories by Mirza Bilal on Medium</title>
            <link>https://medium.com/@mirzabilals?source=rss-fb609e2b855------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 18:26:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mirzabilals/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Advantages of Choosing Baseline GPU Instances]]></title>
            <link>https://towardsaws.com/advantages-of-choosing-baseline-gpu-instances-on-aws-cloud-123cd65743f8?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/123cd65743f8</guid>
            <category><![CDATA[cloud-scaling]]></category>
            <category><![CDATA[horizontal-scaling]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-infrastructure]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 09:38:35 GMT</pubDate>
            <atom:updated>2024-01-22T06:54:36.337Z</atom:updated>
            <content:encoded><![CDATA[<h4>Larger GPU Instances Don’t Always Mean Faster Processing</h4><figure><img alt="Vertical Scaling GPU Instances" src="https://cdn-images-1.medium.com/max/1024/1*hPkhh4Sud9tbv1L7NYTeTQ.png" /></figure><p>The artificial intelligence, machine learning, and generative AI application’s growth have swelled the demand for high-performance GPU workloads. To fulfill these needs, cloud services have introduced a broad range of instances to fulfill diverse needs. For many <a href="https://mirzabilal.com/scaling-the-cloud-vertical-and-horizontal-scaling-strategies#heading-vertical-scaling">vertical scaling</a> has been an quick fix to increase computational power by replacing a smaller instance with a more powerful one. However, this methodology might be less effective, or even pointless for GPU-intensive workloads.</p><h3>Understanding GPU Workloads</h3><p>GPUs are designed for high-speed mathematical calculations. These specialized computational capabilities make them a good choice or for some applications the only option for handling large dataset mathematical operations in machine learning (ML) and video editing. CPUs primary aim is to perform sequential task execution, whereas GPUs excel as the workhorses when it comes to deep learning, 3D rendering, and scientific computations.</p><h3>The Basics of GPU Scaling</h3><p>Instances can be scaled vertically, horizontally or through a combination of both as explained <a href="https://mirzabilal.com/scaling-the-cloud-vertical-and-horizontal-scaling-strategies">here</a>. The Vertical scaling strategy means upgrading to a larger server with more computational power, such as CPU, memory, and GPU. The Horizontal scaling strategy involves adding more instances instead of upgrading the current one, hence increasing resources in parallel, very much like buying additional properties in the neighborhood to accommodate your growing family.</p><h3>Limitations of Vertical Scaling for GPUs</h3><p>Vertical scaling’s effectiveness is evident when we need more CPU or memory resources, but it hits a roadblock with GPU workloads. This is because upgrading to a larger instance does not necessarily increase the GPU’s computational power. For example, the <a href="https://instances.vantage.sh/?filter=g5g%7Cg4dn&amp;sort=gpus">g5g.large and g4dn.large</a> instances from AWS both house the Nvidia Tesla T4 and T4G respectively. Despite any vertical scaling between these instance types, the GPU power remains unchanged, as they contain the same number of GPU cores as shown in the following image. Hence vertical scaling will not address the actual bottleneck in GPU-intensive tasks.</p><figure><img alt="Various GPU Instances: Same GPU power, regardless of instance size" src="https://cdn-images-1.medium.com/max/1024/0*x5tI1_aLVVb9Rzk0" /><figcaption><a href="https://instances.vantage.sh/?filter=g5g%7Cg4dn&amp;sort=gpus">Various GPU Instances: Same GPU power, regardless of instance size</a></figcaption></figure><h3>Practical Implications</h3><p>The implication is evident: when your application demands more GPU power, vertically scaling your instance will not deliver the required performance improvements. This inefficiency can lead to not just stagnant performance, but also increased costs, as you are paying for additional CPU and memory resources that your workload may never utilize.</p><h3>An alternative to Vertical Scaling</h3><p>When the bottleneck is GPU computational capabilities, horizontal scaling becomes a more viable solution. By adding more instances to your cloud infrastructure, you can achieve a near-linear increase in GPU capabilities. Horizontal scaling with right kind of servers will improve your infrastructure’s resource utilization, thus offering a more cost-effective solution. Training an ML model with a vertically scaled server will add more CPU and memory but will not improve GPU power. Therefore, there will not be any improvement in training time. Shifting to horizontal scaling, with multiple GPU instances working in tandem, can significantly reduce the training time, showcasing the right approach to scaling for such tasks.</p><h3>Conclusion</h3><p>While vertical scaling offers a quick solution for prompt performance boost in certain scenarios, it falls short with GPU instances option available. I highly recommend checking out <a href="https://mirzabilal.com/scaling-the-cloud-vertical-and-horizontal-scaling-strategies">horizontal and vertical scaling</a> for a deeper understanding of when to employ each strategy. A nuanced grasp of these scaling methods is crucial for optimizing performance and effective cost management in various computational scenarios. For tasks that are GPU-bound, adding more GPU power through horizontal scaling or re-architecting the solution is often the more effective path. Even for horizontal scaling, opt for the least powered instance, such as G5g.xlarge or G4dn.xlarge, to avoid paying for extra unused CPU power that is not required. Adopting the right scaling strategy, you can ensure that your infrastructure is not just robust but also cost-effective and performance-optimized for your specific computational needs.</p><p><em>Originally published at </em><a href="https://mirzabilal.com/the-downside-of-vertical-scaling-gpu-instances"><em>https://mirzabilal.com</em></a><em> on January 14, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=123cd65743f8" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/advantages-of-choosing-baseline-gpu-instances-on-aws-cloud-123cd65743f8">Advantages of Choosing Baseline GPU Instances</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling the Cloud: Expert Strategies for Vertical and Horizontal Scale]]></title>
            <link>https://mirzabilals.medium.com/scaling-the-cloud-expert-strategies-for-vertical-and-horizontal-scale-9f91303c0574?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f91303c0574</guid>
            <category><![CDATA[horizontal-scaling]]></category>
            <category><![CDATA[cloud-scaling]]></category>
            <category><![CDATA[cloud-scalability]]></category>
            <category><![CDATA[cloud-infrastructure]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Sat, 06 Jan 2024 23:16:35 GMT</pubDate>
            <atom:updated>2024-01-07T18:17:10.527Z</atom:updated>
            <content:encoded><![CDATA[<h4>Discover the Best Scaling Strategy for Your Cloud Infrastructure</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5W5PNIxMkxcGqTg_rRz-Mg.png" /></figure><p>In the ever-expanding digital empire, a multitude of apps and solutions emerge with the intent to simplify human lives and boost productivity. As the demand for efficiency grows, cloud service providers have introduced a diverse array of options to cater to these evolving needs. Organizations want to optimize their infrastructure for cost-effectiveness without compromising on quality of service.</p><p>The need to scale the infrastructure has never been greater. No infrastructure can remain stagnant, and inevitably, there comes a time when scaling is essential to match these growing needs. In this article, I will discuss the concept of horizontal and vertical scaling, delving into the intricacies of each approach. This writing aims to provide insights into which scaling method — horizontal or vertical — will best suit your specific requirements, helping you make informed decisions for your infrastructure needs.</p><h3>Vertical Scaling</h3><figure><img alt="Vertical Scaling" src="https://cdn-images-1.medium.com/max/1024/0*H4XTT2tKgKlUbRSU" /></figure><p>Picture a two-story home standing tall, meeting your initial needs comfortably. Life is good; everything fits adequately within those two floors. However, as your family grows and your lifestyle evolves, the need for additional space becomes apparent. Instead of buying land and uprooting another adjacent building, you decided to add more floors to accommodate your growing needs.</p><p>Let’s draw a parallel to this housing expansion in the domain of cloud computing. Imagine you are using an AWS C6g.large instance with 2 vCPUs and 4GiB of Memory to process PDF documents. It has served you well for a while, but as your product gains more traction, the demand for processing PDFs increases. To address this challenge, you require more computational power.</p><p>In this scenario, you decide to replace your AWS instance with a larger one, such as C6g.xlarge, which comes with 4 vCPUs and 8GiB of memory. This upgrade effectively adds more “floors” to your digital dwelling, allowing you to process twice as many PDFs as compared to the previous instance. This phenomenon of replacing a smaller instance with a larger one is known as “Vertical Scaling” in the cloud computing landscape.</p><h3>Horizontal Scaling</h3><figure><img alt="Horizontal Scaling" src="https://cdn-images-1.medium.com/max/1024/0*T52LkhBvIcLqfyq9" /></figure><p>Imagine the same scenario where your two-story home has become insufficient for your needs. However, instead of stacking more floors onto the existing structure, you decide to build or buy an adjacent building.</p><p>Let’s relate this expanding housing strategy and the increasing processing capability of cloud computing. Consider a situation where a single AWS C6g.large instance is processing PDF documents for you, but it’s no longer sufficient to meet your growing needs.</p><p>Instead of replacing the existing instance with a larger one, you adopt a different strategy. You decide to add another C6g.large instance to your computing arsenal. Each instance operates independently but contributes to the overall processing power. This concept of adding replica instances is known as “Horizontal Scaling” in the cloud computing realm.</p><h3>Conclusion</h3><p>Vertical and Horizontal Scaling both strategies play a crucial role in optimizing computational resources. Vertical scaling, with its simplicity in enhancing power without altering workloads, offers a straightforward approach for immediate performance improvements. On the other hand, horizontal scaling stands out in cloud computing for its remarkable flexibility, allowing easy adjustment of resources to meet fluctuating demands. The most effective computing solutions often emerge from a hybrid approach: optimizing an instance through vertical scaling to align precisely with specific workload requirements and then employing this tailored solution within a horizontal scaling framework. This combination harnesses the strengths of both vertical and horizontal scaling, providing a robust and adaptable infrastructure for various computing needs.</p><h3>More From the Author</h3><ul><li><strong>Dark Truth about AWS Deep Learning AMIs:</strong> <em>The Silent Roadblock to Your Success!</em> Learn How to Break Free at <a href="https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix">How Your AWS Deep Learning AMI is Holding You Back</a></li><li><strong>Cost-Effective Deep Learning with Custom AMIs and Spot Instances:</strong> <em>Discover Cutting-Edge Insights!</em> Explore the full article: <a href="https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d">Deep Learning with AWS Graviton2 and Nvidia Tensor T4g</a></li><li><strong>How to Compile and Fine-Tune FFmpeg for Optimal Performance:</strong> <em>Tailoring your multimedia toolkit for best performance!</em> Follow the detailed instructions on <a href="https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source">Install FFmpeg from Source</a></li><li><strong>GPU Acceleration for FFmpeg:</strong> <em>A Step-By-Step Guide with Nvidia GPU on AWS!</em> Check the complete guide at <a href="https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws">Enable Harware Accelaration with FFmpeg</a></li><li><strong>CPU vs GPU Benchmark for video Transcoding on AWS:</strong> <em>Debunking the CPU-GPU myth!</em> See for yourself at <a href="https://mirzabilal.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth">Challenging the Video Encoding Cost-Speed Myth</a></li><li><strong>Crafting the Team for Sustainable Success:</strong> <em>Are “Rockstars” the Ultimate Solution for a Thriving Team?</em> Explore the insights at <a href="https://mirzabilal.com/beyond-rockstars-crafting-the-team-for-sustainable-success">Beyond Rockstars</a></li><li><strong>How “Builders” Transform Team’s Productivity:</strong> <em>Navigating Vision &amp; Ideas to Reality!</em> Discover more about Builders at <a href="https://mirzabilal.com/bridging-dreams-and-reality-how-builders-transform-teams">Bridging Dreams and Reality</a></li><li><strong>Mental Well-being in Tech:</strong> <em>Cultivating a Healthier Workplace for Tech Professionals</em> Explore insights: <a href="https://mirzabilal.com/the-dark-side-of-high-tech-success-addressing-mental-well-being-in-tech">The Dark Side of High-Tech Success!</a></li><li><strong>Freelancer to Full-Time:</strong> <em>Understanding Corporate Reluctance. Discover insights at</em> <a href="https://mirzabilal.com/why-businesses-hesitate-to-employ-freelancers-unveiling-the-reasons">Why Businesses Hesitate to Employ Freelancers</a></li><li><strong>Transitioning from Freelancer to Full-Time:</strong> <em>Hurdles to Overcome!</em> Check out <a href="https://mirzabilal.com/why-businesses-hesitate-to-employ-freelancers-unveiling-the-reasons">Why Businesses Hesitate to Employ Freelancers</a></li><li><strong>Scaling the Cloud:</strong> <em>Discover the Best Scaling Strategy for Your Cloud Infrastructure at</em> <a href="https://mirzabilal.com/scaling-the-cloud-vertical-and-horizontal-scaling-strategies">Vertical and Horizontal Scaling Strategies</a></li><li><strong>The Future of Efficient Backend Development:</strong> <em>Efficient Backend Development with Outerbase!</em> Discover the details at <a href="https://mirzabilal.com/building-a-robust-backend-in-just-30-minutes-with-outerbase">Building a Robust Backend with Outerbase</a></li></ul><p><em>Originally published at </em><a href="https://mirzabilal.com/scaling-the-cloud-vertical-and-horizontal-scaling-strategies"><em>https://mirzabilal.com</em></a><em> on January 6, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f91303c0574" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Businesses Hesitate to Hire Freelancers]]></title>
            <link>https://mirzabilals.medium.com/why-businesses-hesitate-to-employ-freelancers-29804c554ec1?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/29804c554ec1</guid>
            <category><![CDATA[hiring-guide]]></category>
            <category><![CDATA[freelancing]]></category>
            <category><![CDATA[full-time-jobs]]></category>
            <category><![CDATA[startup-jobs]]></category>
            <category><![CDATA[hiring-tips]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Wed, 08 Nov 2023 13:38:58 GMT</pubDate>
            <atom:updated>2023-11-08T13:38:58.225Z</atom:updated>
            <content:encoded><![CDATA[<h4>Transitioning from Freelancer to Full-Time: Hurdles to Overcome</h4><figure><img alt="Why Companies don’t hire freelancers?" src="https://cdn-images-1.medium.com/max/1024/1*vPIgp9tr80lh7Rs7cHNqwA.png" /></figure><p>Hiring the right candidate for an organization can be a daunting task, as finding the perfect fit is never guaranteed despite a thorough hiring process. There is no mathematical equation for assessing a candidate’s qualifications. Evaluating a candidate primarily hinges on two factors: “ <strong>Technical Ability</strong>” and “ <strong>Cultural Fit</strong>”. Technical skills are relatively easier to measure than finding a cultural fit for the team, especially while evaluating during the few hours of the interview process.</p><h3>The Guiding Principles</h3><p>Despite the effort invested, there’s no surety the selected candidate is technically equipped and the perfect fit for the team, leading to a leap of faith. To mitigate hiring risks for a full-time job, we have formalized several rules. One significant rule emphasizes:</p><h3>Freelancers and Challenges</h3><p>Drawing from our experiences working with long-term freelancers, we have identified some common quirks among many individuals. If you’re a freelancer considering this shift, we’ve pinpointed traits that should be addressed for a successful transition.</p><figure><img alt="Not my job!" src="https://cdn-images-1.medium.com/max/1024/0*VhOuuvUfkozWKiP5" /><figcaption>Source: <a href="https://imgur.com/orEha77">https://imgur.com/orEha77</a></figcaption></figure><h4>Approach to Problem Solving 🧩</h4><p>Freelancers often approach problem-solving differently from full-time employees. Through their extensive experience in various freelance projects, they might start embracing the “ <strong>If It’s Working, It’s Done”</strong> mindset. This approach prioritizes immediate functionality and might disregard the best practices for task completion, potentially impacting the project’s overall health, team coordination, and successful goal achievement.</p><h4>Collaboration Struggles 🖇️</h4><p>Freelancers’ prolonged solo work impacts their team collaboration skills, making it challenging for them to coordinate within the team and other teams in the organization. This lack of team experience often results in difficulties when attempting to synchronize efforts within the organization.</p><figure><img alt="Isn’t it the same?" src="https://cdn-images-1.medium.com/max/662/0*qObBt42aIXx29Cy-" /><figcaption>Source: <a href="https://cheezburger.com/16245253/cursed-and-flawed-stairs-that-are-up-to-something">https://cheezburger.com/16245253/cursed-and-flawed-stairs-that-are-up-to-something</a></figcaption></figure><h4>No Strings Attached Mindset 🔄</h4><p>Freelancers often cultivate a habit of transiting from one project to another, nurturing a constant “ <strong>Urge for Change</strong>” within themselves. Organizations looking for stability invest in candidates with the anticipation of a more enduring commitment and are caught off guard by departures within a short span of 2 to 3 months at times.</p><h4>Short-Sightedness ⚙️</h4><p>The idea of “Be your own man” and doing everything on your own may seem powerful, but it’s even more important to recognize the significance of being part of something bigger and creating things that fit flawlessly with others. The nature of freelancing sometimes requires a shorter-term focus on immediate tasks or projects and does not realize “ <strong>Your work will be a cog in the machine instead of the machine itself</strong>”. Companies prefer candidates who can take a more holistic and long-term view, contributing to the broader vision and goals of the company, rather than focusing solely on short-term tasks. Forward-thinkers who foresee future needs are the architects behind groundbreaking products.</p><h4>The Performance Metrics 📈</h4><p>High-performance applications significantly influence user satisfaction, productivity, and competitive advantage in today’s market. The Freelancer’s “ <strong>quantity over quality</strong>” approach for delivering tasks quickly, with minimal effort and time, often leads to subpar unoptimized output. These modules and products adversely affect product performance, leading to customer dissatisfaction, impeding growth, and negatively impacting customer retention.</p><h3>Conclusion</h3><blockquote><em>“ </em>Pleasure in the job puts perfection in the work.<em>”</em></blockquote><blockquote><em>— Aristotle</em></blockquote><p>The purpose of the discussion is not to devalue the role of freelancers, rather it is important to acknowledge their significant contributions to the thriving tech industry. While freelancers bring so much to the table, their alignment with organizational objectives often poses challenges. Recognizing the strengths and understanding the potential discord between freelancing and long-term goals is essential for refining hiring strategies and ensuring an ideal match for both employees and organizations. Freelancers, too, should introspect on these common issues discussed and address them, regardless of pursuing a full-time job or continuing in their freelancing career.</p><h3>More From the Author</h3><ul><li><strong>Dark Truth about AWS Deep Learning AMIs:</strong> <em>The Silent Roadblock to Your Success!</em> Learn How to Break Free at <a href="https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix">How Your AWS Deep Learning AMI is Holding You Back</a></li><li><strong>Cost-Effective Deep Learning with Custom AMIs and Spot Instances:</strong> <em>Discover Cutting-Edge Insights!</em> Explore the full article: <a href="https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d">Deep Learning with AWS Graviton2 and Nvidia Tensor T4g</a></li><li><strong>How to Compile and Fine-Tune FFmpeg for Optimal Performance:</strong> <em>Tailoring your multimedia toolkit for best performance!</em> Follow the detailed instructions on <a href="https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source">Install FFmpeg from Source</a></li><li><strong>GPU Acceleration for FFmpeg:</strong> <em>A Step-By-Step Guide with Nvidia GPU on AWS!</em> Check the complete guide at <a href="https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws">Enable Harware Accelaration with FFmpeg</a></li><li><strong>CPU vs GPU Benchmark for video Transcoding on AWS:</strong> <em>Debunking the CPU-GPU myth!</em> See for yourself at <a href="https://mirzabilal.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth">Challenging the Video Encoding Cost-Speed Myth</a></li><li><strong>Crafting the Team for Sustainable Success:</strong> <em>Are “Rockstars” the Ultimate Solution for a Thriving Team?</em> Explore the insights at <a href="https://mirzabilal.com/beyond-rockstars-crafting-the-team-for-sustainable-success">Beyond Rockstars</a></li><li><strong>How “Builders” Transform Team’s Productivity:</strong> <em>Navigating Vision &amp; Ideas to Reality!</em> Discover more about Builders at <a href="https://mirzabilal.com/bridging-dreams-and-reality-how-builders-transform-teams">Bridging Dreams and Reality</a></li><li><strong>Mental Well-being in Tech:</strong> <em>Cultivating a Healthier Workplace for Tech Professionals</em> Explore insights: <a href="https://mirzabilal.com/the-dark-side-of-high-tech-success-addressing-mental-well-being-in-tech">The Dark Side of High-Tech Success!</a></li><li><strong>Transitioning from Freelancer to Full-Time: </strong><em>Hurdles to Overcome!</em> Check out <a href="https://mirzabilal.com/why-businesses-hesitate-to-employ-freelancers-unveiling-the-reasons">Why Businesses Hesitate to Employ Freelancers</a></li><li><strong>The Future of Efficient Backend Development:</strong> <em>Efficient Backend Development with Outerbase!</em> Discover the details at <a href="https://mirzabilal.com/building-a-robust-backend-in-just-30-minutes-with-outerbase">Building a Robust Backend with Outerbase</a></li></ul><p><em>Originally published at </em><a href="https://mirzabilal.com/why-businesses-hesitate-to-employ-freelancers-unveiling-the-reasons"><em>https://mirzabilal.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29804c554ec1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPU Hardware Acceleration for Chrome, Chromium, and Puppeteer on AWS]]></title>
            <link>https://towardsaws.com/gpu-hardware-acceleration-for-chrome-chromium-and-puppeteer-on-aws-d11715b633ac?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/d11715b633ac</guid>
            <category><![CDATA[headless-browser]]></category>
            <category><![CDATA[gpu-acceleration]]></category>
            <category><![CDATA[hardware-acceleration]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 04:51:44 GMT</pubDate>
            <atom:updated>2023-10-27T04:51:44.379Z</atom:updated>
            <content:encoded><![CDATA[<h4>How We Enhanced Remotion Performance through GPU-Accelerated Server-Side Rendering</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFh8l9ii7C4Rp0gzygnXlA.png" /></figure><p>Running <a href="https://developer.chrome.com/blog/headless-chrome/">Google Chrome</a> with hardware acceleration in headless mode can be more challenging than it appears. We embarked on this journey with <a href="https://remotion.dev/">Remotion</a>, which is an excellent framework that enables developers to “Make Videos Programmatically”. On our way, explore various Nvidia driver versions, including those from Nvidia’s website and Ubuntu’s official repositories.</p><p>We collaborated with the vibrant <a href="https://remotion.dev/">Remotion</a> Open-source community to find the answer for using <a href="https://github.com/remotion-dev/remotion/issues/2889">GPU with Remotion for server-side rendering</a>. After encountering some setbacks on our way, we were able to make it work for Remotion eventually. We consolidated our findings in the Remotion Docs at <a href="https://remotion-git-gpu-on-ec2-remotion.vercel.app/docs/miscellaneous/cloud-gpu">Using the GPU in the Cloud</a> and simplified the instructions for Remotion developers to make the most out of it. Although the whole research was done for <a href="https://remotion.dev/">Remotion</a>, the same process will work for any headless application that requires GPU power, especially in headless mode.</p><h3>Hardware Acceleration in Browser Rendering</h3><p>Hardware Acceleration is to your browser what “ <strong>Nitrogen Fuel</strong>” is for a gasoline car. It uses the power of specialized hardware like GPUs to make your web pages load faster and videos play smoothly. Hardware acceleration improves the part where the web page is displayed and shown to you, known as rendering. This results in a smoother and snappier browsing experience.</p><h3>DLAMI from Marketplace?</h3><p>One may wonder why we didn’t opt for the AWS Deep Learning AMI or DLAMI. But we needed fine-grained control over the GPU drivers and utilities, and the outdated DLAMIs despite all the bloatware was not the answer. Such tasks are often challenging to achieve with pre-packaged AMIs as discussed in “ <a href="https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix">Why Deep Learning AMI is Holding You Back</a>”. Tailoring the environment to our exact requirements also helped us troubleshoot issues effectively.</p><p>We experimented with multiple packages, to identify the key ones needed for Google Chrome to recognize the GPU. Despite these efforts, GPU recognition remained elusive, and in some instances, GPU drivers were crashing even at initialization. The long and arduous journey has brought us to the end of the tunnel, yet the darkness persists, and the solution remains as elusive as ever. As we decided to call it a day, We stumbled upon <a href="https://github.com/puppeteer/puppeteer/issues/3637">this thread</a> on <a href="https://pptr.dev/">Puppeteer</a>’s Github issues, which did not give us any hope, but did give us a new perspective and drive to achieve our goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wo5UDPmfbqV3p_FB" /><figcaption>Puppeteer community is also facing similar issues with hardware acceleration in headless mode.</figcaption></figure><h3>The Fresh Start</h3><p>It was time to return to the drawing board and start afresh. We started with a clean base Ubuntu AMI on AWS EC2 Instance. After that, we downloaded and installed the Nvidia Tesla T4G drivers from Nvidia’s official website.</p><p>Once confirmed that the GPU was working properly using nvidia-smi, We installed Google Chrome and tested it for hardware acceleration, to our relief Google Chrome finally gave a nod to work with Hardware Acceleration.</p><h3>Launching an EC2 Instance</h3><p>Launching an EC2 instance can be achieved in various ways, with the AWS Web Console and AWS CLI being two notable options. Regardless of the method, the important parameters are instance type and AMI selection. At the time of writing, the AMI ID for our chosen instance g4dn.xlarge is ami-053b0d53c279acc90. For launching the EC2 instance via aws-cli, the following command can be used, after replacing the placeholders with actual values.</p><pre>aws ec2 run-instances \<br>  --instance-initiated-shutdown-behavior &quot;terminate&quot; \<br>  --image-id &quot;ami-053b0d53c279acc90&quot; \<br>  --instance-type &quot;g4dn.xlarge&quot; \<br>  --key-name &quot;&lt;KEY_NAME&gt;&quot; \<br>  --subnet-id &quot;&lt;SUBNET_ID&gt;&quot; \<br>  --security-group-ids &quot;&lt;SECURITY_GROUP_ID&gt;&quot; \<br>  --iam-instance-profile Arn=&quot;&lt;ARN&gt;&quot; \<br>  --block-device-mappings &#39;[<br>  {<br>    &quot;DeviceName&quot;: &quot;/dev/sda1&quot;,<br>    &quot;Ebs&quot;: {<br>      &quot;VolumeSize&quot;: 8,<br>      &quot;VolumeType&quot;: &quot;gp3&quot;<br>    }<br>  }<br>]&#39;</pre><h3>Ubuntu Upgrade</h3><p>Ubuntu 22.04 AMI ami-053b0d53c279acc90 on AWS comes with Linux Kernel v5 (specifically 5.19.0-1025-aws). At this point, we have two options either we stick with Kernel v5 or Upgrade to v6 ( v6.2.0-1013-aws), we decided to upgrade the Kernel. This decision is crucial as the Nvidia driver compiled for one version will not work for the other.</p><p>After launching the instance, SSH into the instance and initiate the Ubuntu packages upgrade process. To update all the installed packages including Linux Kernel execute the following one-liner.</p><pre>sudo bash -c &quot;apt update &amp;&amp; export DEBIAN_FRONTEND=noninteractive &amp;&amp; export NEEDRESTART_MODE=a &amp;&amp; apt upgrade -y &amp;&amp; reboot&quot;</pre><p>We can also split apt update, apt upgrade -y and reboot. But the reason behind doing it like this is to install these updates in non-interactive mode.</p><p>After the execution, the system will reboot with Linux Kernel Version 6. We can confirm the kernel update with uname -r. Rebooting is essential when upgrading the Ubuntu system because it loads the new Kernel on the next boot, and Nvidia drivers will subsequently be built for the updated version.</p><h3>Nvidia GPU Driver Installation</h3><p>The process of installing GPU drivers is straightforward when we have the correct driver for the GPU and the corresponding compatible version. Before starting the installation we need to install a couple of packages: build-essential and libvulkan1 . The former is a bundle with a variety of compilation tools required to compile the Nvidia driver. The latter, while not mandatory, is required by Google Chrome. Therefore it&#39;s a good idea to install it beforehand to enable support for Vulkan ICD loader for Nvidia, should we require it in the future.</p><pre>sudo apt install -y build-essential libvulkan1</pre><p>After build tools are installed, we can proceed to download and install the GPU drivers using the following commands:</p><pre>DRIVER_URL=&quot;https://us.download.nvidia.com/tesla/535.104.12/NVIDIA-Linux-x86_64-535.104.12.run&quot;<br>DRIVER_NAME=&quot;NVIDIA-Linux-driver.run&quot;<br>wget -O &quot;$DRIVER_NAME&quot; &quot;$DRIVER_URL&quot;<br>sudo sh &quot;$DRIVER_NAME&quot; --disable-nouveau --silent<br>rm &quot;$DRIVER_NAME&quot;</pre><p>Now we can run nvidia-smi to confirm the GPU drivers installation. The output will look similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*egZx--a9qY5kcuYi" /><figcaption>nvidia-smi</figcaption></figure><h3>Configuring the Startup Service</h3><p>We learned this the hard way: running nvidia-smi once is needed for the proper initialization of EGL and ANGLE. Google Chrome and Chromium fail to initialize EGL without this preliminary setup. To automate this process, we will create a service that runs nvidia-smi at boot time using following commands:</p><pre>echo &#39;[Unit]<br>Description=Run nvidia-smi at system startup<br><br>[Service]<br>ExecStart=/usr/bin/nvidia-smi<br>Type=oneshot<br>RemainAfterExit=yes<br><br>[Install]<br>WantedBy=multi-user.target&#39; | sudo tee /etc/systemd/system/nvidia-smi.service<br>sudo systemctl enable nvidia-smi.service<br>sudo systemctl start nvidia-smi.service</pre><h3>Testing the Installation</h3><p>To test hardware acceleration with Google Chrome or Chromium, we can follow these steps. It’s worth noting that Google Chrome has more dependencies, making it an easier choice if we plan to use the Node.js library, Puppeteer.</p><p>On the other hand, Chromium is a lightweight option with a smaller footprint of dependencies, but we can still use Puppeteer with Chromium by installing a few extra dependencies.</p><h3>Chromium</h3><ul><li><strong>Installation:</strong><br>Installing Chromium is straightforward, as it is readily available with Ubuntu’s official software repositories. We can install it using apt with the following command.</li></ul><pre>sudo apt install -y chromium-browser</pre><ul><li><strong>Testing:</strong><br>Chromium is fully prepared to handle Hardware Acceleration tasks. We can verify its readiness by launching Chromium with the specified parameters.</li></ul><pre>chromium-browser --headless --use-gl=angle \<br>  --use-angle=gl-egl --use-cmd-decoder=passthrough \<br>  --print-to-pdf=output.pdf &#39;chrome://gpu&#39;</pre><p>To use Puppeteer with Chromium instead of Google Chrome, there are a few extra dependencies that should be installed.</p><pre>sudo apt install ca-certificates fonts-liberation \<br>  libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 \<br>  libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 \<br>  libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 \<br>  libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \<br>  libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 \<br>  libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \<br>  libxtst6 lsb-release wget xdg-utils</pre><h3>Google Chrome</h3><ul><li><strong>Installation:<br></strong>Google Chrome can be installed from multiple options, but we will use the Google Chrome official repository for Debian. We need to add it to Ubuntu’s repo list along with the public signing key.</li></ul><pre>curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/googlechrom-keyring.gpg<br>echo &quot;deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrom-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main&quot; | sudo tee /etc/apt/sources.list.d/google-chrome.list<br>sudo apt update<br>sudo apt install -y google-chrome-stable</pre><ul><li><strong>Testing</strong>:<br>Google Chrome is ready for our Hardware Acceleration tasks. We can test it by launching Google Chrome with the following parameters.</li></ul><pre>google-chrome-stable --headless --use-gl=angle \<br>    --use-angle=gl-egl --use-cmd-decoder=passthrough \<br>    --print-to-pdf=output.pdf &#39;chrome://gpu&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*JBl7ulldjgAEkY63" /></figure><h3>Working with Puppeteer</h3><p>To verify GPU acceleration using the Node.js library Puppeteer, follow these steps:</p><ul><li>Install Node.js as this clean Ubuntu AMI does not include any unnecessary packages. Use the following commands:</li></ul><pre>curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg<br>NODE_MAJOR=18<br>echo &quot;deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main&quot; | sudo tee /etc/apt/sources.list.d/nodesource.list<br>sudo apt update<br>sudo apt install nodejs</pre><ul><li>After installing Node.js, we can install Puppeteer by running npm i puppeteer in our code directory. Here&#39;s a sample index.js file for checking hardware acceleration:</li></ul><pre>const puppeteer = require(&#39;puppeteer&#39;);<br>(async () =&gt; {<br>  const browser = await puppeteer.launch({<br>    headless: true, <br>    args: [&#39;--use-gl=angle&#39;, &#39;--use-angle=gl-egl&#39;], <br>  });<br>  const page = await browser.newPage();<br>  await page.goto(&#39;chrome://gpu&#39;);<br>  await page.waitForTimeout(2000);<br>  await page.screenshot({ path: &#39;output.png&#39; });<br>  await browser.close();<br>})();</pre><h3>Note from the Creator</h3><blockquote><a href="https://mirzabilal.com/"><em>Mirza</em></a><em> has been immensely helpful in helping the “ </em><a href="https://remotion.dev/"><em>Remotion</em></a><em>” community adopt GPU-accelerated rendering.<br>He’s researched and written about how to obtain, configure and run EC2 containers and headless Chrome correctly in order to take advantage of graphics acceleration.<br>This area has been especially hard to crack, and without Mirza we would not have been able to unlock huge speed boosts.</em></blockquote><blockquote><em>We are super grateful for that!</em></blockquote><blockquote>— <br><a href="https://jonny.io/">Jonny Burger</a><br>Creator / <a href="http://remotion.dev/">Remotion.dev</a></blockquote><h3>Conclusion</h3><p>With hardware acceleration now readily available in headless mode, we can harness the power of GPUs for faster and more complex rendering tasks. Our next steps involve creating a custom AMI from this instance and streamlining the process using AWS Image Builder Pipelines for efficiency. Additionally, we plan to extend hardware capabilities to Docker containers, further extending our options.</p><h3>Resources</h3><ul><li><strong>Remotion — Make videos programmatically:<br></strong><a href="https://remotion.dev/">https://remotion.dev</a></li><li><strong>Remotion — Using the GPU in the cloud:<br></strong><a href="https://www.remotion.dev/docs/miscellaneous/cloud-gpu">https://www.remotion.dev/docs/miscellaneous/cloud-gpu</a></li><li><strong>Cannot enable GPU acceleration:<br></strong><a href="https://github.com/puppeteer/puppeteer/issues/3637"><em>https://github.com/puppeteer/puppeteer/issues/3637</em></a></li><li><strong>Recommend a workflow for using the GPU on a AWS instance</strong>:<br><a href="https://github.com/remotion-dev/remotion/issues/2889">https://github.com/remotion-dev/remotion/issues/2889</a></li><li><strong>Getting Started with Headless Chrome:<br></strong><a href="https://developer.chrome.com/blog/headless-chrome/"><em>https://developer.chrome.com/blog/headless-chrome/</em></a></li><li><strong>Why Your AWS Deep Learning AMI is Holding You Back and How to Fix:<br></strong><a href="https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix"><em>https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix</em></a></li><li><strong>Deep Learning with “AWS Graviton2 + NVIDIA Tensor T4G” for as low as free* with CUDA 12.2:<br></strong><a href="https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d"><em>https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d</em></a></li><li><strong>How to install FFmpeg with Harware Accelaration on AWS:<br></strong><a href="https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws"><em>https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws</em></a></li><li><strong>CPU vs GPU for Video Transcoding — Challenging the Cost-Speed Myth:<br></strong><a href="https://mirzabilal.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth">https://mirzabilal.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth</a></li></ul><p><em>Originally published at </em><a href="https://mirzabilal.com/how-to-enable-hardware-acceleration-on-chrome-chromium-puppeteer-on-aws-in-headless-mode"><em>https://mirzabilal.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d11715b633ac" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/gpu-hardware-acceleration-for-chrome-chromium-and-puppeteer-on-aws-d11715b633ac">GPU Hardware Acceleration for Chrome, Chromium, and Puppeteer on AWS</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CPU vs GPU for Video Transcoding: Challenging the Cost-Speed Myth]]></title>
            <link>https://towardsaws.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth-b5e0726ce3e8?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5e0726ce3e8</guid>
            <category><![CDATA[ffmpeg]]></category>
            <category><![CDATA[video-transcoding]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[hardware-accelerator]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 07:30:57 GMT</pubDate>
            <atom:updated>2023-10-15T07:30:57.805Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Cost-Centric Benchmarking Never Done Before Using FFmpeg on AWS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iiW7FSHBHMqQ9cc_y3FPqQ@2x.png" /></figure><h3>Introduction</h3><p>When evaluating computational power, especially in terms of CPUs and GPUs, there’s a prevailing narrative. A general belief is, that CPUs may take longer to process, but they’re cost-effective, whereas GPUs might be faster but operate at a higher cost.</p><p><strong>How true is this widely accepted notion?</strong></p><p>To challenge this belief, we conducted a tangible, real-world assessment using AWS instances and FFmpeg for video transcoding benchmarks. And sought to determine the most cost-and-time-efficient option for transcoding videos and audio, hence enabling us to save on our AWS bills.</p><h3>The Selection of Instances</h3><p>In our tests, we compared various AWS instance types, covering both GPU and CPU across Intel and AWS’s Silicon-based Graviton2 instances. On the GPU side, we picked instances featuring Nvidia Tesla T4 and T4G. Whereas for CPUs, we looked at three instances, two from the same generation and size an Intel-based c7i.2xlarge, and Graviton2-powered c7g.2xlarge. The third CPU-based instance we chose was c6g.4xlarge, to assess the impact of more vCPU on transcoding.</p><p>We made thoughtful selections for each of these instances. We aimed to choose those with similar costs to ensure a fair cost-to-performance comparison. Additionally, to explore the performance implications of doubling the CPU count, we extended our benchmarks to the c6g.4xlarge instance.</p><h3>The Process</h3><p>Before analyzing the results, it’s important to discuss and understand the types of tests that were conducted.</p><ol><li><strong>Downscale to 480p: <br></strong><em>Downscaling is the process when the video is squeezed smaller than its original size. It’s useful for platforms or devices that cannot support high-resolution videos or when smaller file sizes are needed. For this test, we downscale the input video to 480p (640 pixels x 480 pixels).</em></li><li><strong>Resample at 720p:<br></strong><em>Resampling does not change the video’s resolution but may alter the underlying pixel values. It can be beneficial for modifying encoding settings or applying specific filters. In this case, we resampled the video at its original resolution of 720p (1280 pixels × 720 pixels).</em></li><li><strong>Upscale to 1080p:<br></strong><em>Upscaling is the opposite of downscaling and is used to convert the video to higher resolution. Upscaling generally produces better results than playing or rendering a smaller video and stretching at playtime. In this test, we upscale the video to a higher resolution of 1080p (1920 pixels × 1080 pixels)</em></li><li><strong>No Scaling:<br></strong><em>All the above tests were conducted using a scale filter of FFmpeg but for this test, we did not provide any filter for scaling instead we simply re-encoded the video.</em></li></ol><h3>Benchmark Details</h3><p>To ensure objectivity, we use the same video file for benchmarking, the input video details are as follows:</p><p>We utilized <a href="https://ffmpeg.org/">FFmpeg</a>, a leading open-source software for multimedia processing, to devise our benchmark script. The script contains tests for both CPU and GPU-powered machines, first, it checks whether GPU is available or not. Depending on the result, it executes the appropriate command for video processing.</p><p>To execute our transcoding tasks, we used the following benchmark script:</p><pre>if lspci | grep -i &quot;NVIDIA Corporation&quot; &gt;/dev/null; then echo &quot;System has a GPU&quot; commands=( &#39;ffmpeg -y -hide_banner -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;scale_cuda=720:480&quot; -c:a copy -c:v h264_nvenc output.mp4 -benchmark&#39; &#39;ffmpeg -y -hide_banner -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;scale_cuda=1280:720&quot; -c:a copy -c:v h264_nvenc output.mp4 -benchmark&#39; &#39;ffmpeg -y -hide_banner -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;scale_cuda=1920:1080&quot; -c:a copy -c:v h264_nvenc output.mp4 -benchmark&#39; &#39;ffmpeg -y -hide_banner -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -c:a copy -c:v h264_nvenc output.mp4 -benchmark&#39; ) else commands=( &#39;ffmpeg -y -hide_banner -i input.mp4 -vf &quot;scale=720:480&quot; -c:a copy -c:v libx264 output.mp4 -benchmark&#39; &#39;ffmpeg -y -hide_banner -i input.mp4 -vf &quot;scale=1280:720&quot; -c:a copy -c:v libx264 output.mp4 -benchmark&#39; &#39;ffmpeg -y -hide_banner -i input.mp4 -vf &quot;scale=1920:1080&quot; -c:a copy -c:v libx264 output.mp4 -benchmark&#39; &#39;ffmpeg -y -hide_banner -i input.mp4 -c:a copy -c:v libx264 output.mp4 -benchmark&#39; ) fi for cmd in ; do echo &quot;--------------------------------------------------------------------------------&quot; echo &quot;Executing: $cmd&quot; echo &quot;--------------------------------------------------------------------------------&quot; { time eval ; } 2&gt;&amp;1 rm output.mp4 done | tee output_results.txt</pre><h3>The Findings</h3><p>The data from our AWS benchmarks after executing 20 different tests over five different AWS Instances, painted a compelling narrative. The results showed clear differences in the cost-efficiency and performance dynamics among these instances. The data extracted and processed from benchmark results can be listed as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UkmPmkfqPbCA4ry6" /></figure><p>The GPU instances, notably AWS Graviton2 g5g.xlarge, were not only faster but also more cost-effective across the various transcoding operations, compared to the CPU-centric instances like c7g.2xlarge. The introduction of the c6g.4xlarge, with its doubled vCPUs, provided insights into how increasing computational power influences performance and cost. Interestingly, even with the added CPUs, despite it being more expensive than GPU-powered instances, it performed significantly worse and GPU instances continue to offer a better balance between speed and cost. Furthermore, it is important to mention here that, the FFmpeg was built to run on multiple cores and was utilizing all CPU cores as can be seen in htop screenshot during a transcoding task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AN-xgYEaSTFuYcYI" /></figure><p>Let’s create a visualization of benchmark results to compare the time taken and cost when running on different EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AgI8A7TbfzYfauwY" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O7uUo-f3gokKJ3hN" /></figure><h3>The Winner?</h3><p>From the previous charts, it’s evident that the AWS Graviton2-based G5g.xlarge emerges as the most efficient choice. Not only does it excel in efficiency, but it also appears to be more cost-effective. To further illustrate its cost advantage, let&#39;s juxtapose it with various AWS instances to discern just how economical it truly is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vg642DH36eHloR7c" /></figure><p>The bar chart offers a vivid representation of how G5g.xlarge stacks up against other AWS EC2 instances in terms of cost. When downscaling to 480p, the G5g.xlarge is significantly more cost-effective, with the c6g.4xlarge, which is the most expensive across different transcoding tasks, which is a whopping 370.9% more expensive than G5g.xlarge for downscaling operations. For the resampling at 720p, the disparity grows even more evident, with the c6g.4xlarge being 445% pricier than the G5g.xlarge. Similarly, when upscaling to 1080p, the cost associated with c6g.4xlarge is 438.9% more than our winner. Finally, for the &#39;No Scaling&#39; operation, c6g.4xlarge proves to be 446.1% more expensive.</p><p>In stark contrast, the g4dn.xlarge, although being one of the GPU-based instances, presents minimal cost differences when compared with G5g.xlarge. Its costs are just around 24.8% to 27% for the various operations, showcasing that while GPUs might be fast, their cost benefits, especially in this case, aren&#39;t always as pronounced.</p><p>These findings underline the impressive cost efficiency of the AWS Graviton2 G5g.xlarge featuring Nvidia Tesla T4G, when placed against other popular AWS instances.</p><h3>In Conclusion</h3><p>The ever-evolving realm of technology often holds narratives based on past truths, which may not hold relevance today. Our experiment underscores a crucial fact: in video transcoding, modern GPU instances aren’t just faster; they also offer a more economical choice. When choosing between a CPU or GPU for cloud-based operations, it’s essential to consider both performance and cost. And as demonstrated, sometimes the supposedly “faster and pricier” option can also be the most cost-effective.</p><h3>Resources</h3><p><em>Compile and Install FFmpeg on CPU</em>:<br><a href="https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source">https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source</a></p><p><em>Running FFmpeg with Hardware acceleration on GPU:<br></em> <a href="https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws">https://mirzabilal.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws</a></p><p><em>Low Cost High Performance Deep Learning:</em><br><a href="https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d">https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d</a></p><p><em>Originally published at </em><a href="https://mirzabilal.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth"><em>https://mirzabilal.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5e0726ce3e8" width="1" height="1" alt=""><hr><p><a href="https://towardsaws.com/cpu-vs-gpu-for-video-transcoding-challenging-the-cost-speed-myth-b5e0726ce3e8">CPU vs GPU for Video Transcoding: Challenging the Cost-Speed Myth</a> was originally published in <a href="https://towardsaws.com/">Towards AWS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install FFmpeg with Harware Accelaration on AWS]]></title>
            <link>https://mirzabilals.medium.com/how-to-install-ffmpeg-with-harware-accelaration-on-aws-109c07e70d2b?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/109c07e70d2b</guid>
            <category><![CDATA[amazon-linux-2023]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[ffmpeg]]></category>
            <category><![CDATA[hardware-acceleration]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Mon, 25 Sep 2023 06:02:24 GMT</pubDate>
            <atom:updated>2023-09-25T06:02:24.783Z</atom:updated>
            <content:encoded><![CDATA[<h4>A step-by-step guide for FFmpeg with Nvidia GPU on AWS for ARM, AArch64, or x86_64 across Amazon Linux 2023, Ubuntu, and more</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itntCSARCRp4vxT9hrkBCw.png" /></figure><h3>Introduction</h3><p>Video is not just a story; it is the storyteller. It weaves narratives, captures moments, and connects us in ways words alone cannot. The ever-increasing demand for video content in marketing, streaming and OTT platforms, social media, and mobile video consumption has increased the demand for bandwidth and server capacity. Cloud media processing has revolutionized the media industry, enhancing accessibility to video content beyond previous boundaries. The continuously increasing appetite for multimedia content and the growing prominence of deep learning have driven industry leaders like Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform to offer GPU-enabled instances tailored for parallel processing excellence.</p><p>FFmpeg is an indispensable multimedia innovation champion, consistently delivering eminence in audio-video processing and transcoding. If you are new to FFmpeg or need to setup FFmpeg for optimal performance on CPU, you can refer to the first article of this series, <a href="https://medium.com/@mirzabilals/how-to-install-ffmpeg-on-linux-from-source-4cd6fc012d39">How to install FFmpeg on Linux from Source</a> where we discussed about FFmpeg and provided a step-by-step guide to make the most out of FFmpeg on CPU.</p><p>Now we will take a step further and look into how FFmpeg can leverage the power of hardware acceleration, which can significantly reduce processing time and help deliver content to users faster than ever before. This How-to guide will show you how to set up FFmpeg for multimedia transcoding and other multimedia task with hardware acceleration.</p><h3>Problem</h3><p>Traditional CPU-based video processing on cloud servers can be time-consuming and inefficient. As videos increase in resolution and size, the processing demand grows exponentially. Even with multi-core CPU configurations, the computational overhead can cause extended processing times, leading to delays in workflows and increased costs. Given cloud infrastructure providers charge per instance-hour, the longer your server runs, the more expensive your bill becomes. Failing to embrace GPU-powered machines means underutilizing their potential, especially since GPUs are specifically designed for parallel computational tasks. Thus, there is a pressing need to harness the GPU’s power to optimize FFmpeg’s performance and make the most out of it.</p><h3>The Remedy</h3><h3>Know your Hardware</h3><p>The first step is to figure out the GPU for your required architecture. For the scope of this guide, we will focus on <strong>Nvidia Tesla T4</strong> and <strong>Nvidia Tesla T4G</strong> available with AWS Graviton2 G4g and Intel-based G4dn instances on AWS, but you can follow this guide for any Nvidia GPU by installing the desired driver yourself or by following <a href="https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d#heading-install-nvidia-gpu-driver">this guide</a> and getting the appropriate driver from the <a href="https://www.nvidia.com/Download/Find.aspx">Nvidia driver download center</a>.</p><h3>Update and Install System Utilities</h3><p>The following snippet updates your existing libraries and other utilities. It uses some variables that are defined in the final script.</p><pre>echo &quot;Installing utilities...&quot;<br>dnf -y update<br>dnf -y groupinstall &quot;Development Tools&quot;<br>dnf install -y openssl-devel cmake3 amazon-efs-utils htop iotop yasm nasm jq</pre><h3>Setup Nvidia GPU, CUDA, and CUDNN</h3><p>As the scope of this article is to demonstrate a working GPU-powered FFmpeg on AWS, the following will check whether this is the Graviton2-powered G4g instance which is based on ARM/AARCH64 architecture or an Intel-based G4dn instance. Once selected, script will install the appropriate drivers for the architecture.</p><pre>if [ &quot;$(uname -m)&quot; = &quot;aarch64&quot; ]; then<br>    echo &quot;System is running on ARM / AArch64&quot;<br>    DRIVE_URL=&quot;https://us.download.nvidia.com/tesla/535.104.05/NVIDIA-Linux-aarch64-535.104.05.run&quot;<br>    CUDA_SDK_URL=&quot;https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux_sbsa.run&quot;<br>    CUDNN_ARCHIVE_URL=&quot;https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-sbsa/cudnn-linux-sbsa-8.9.5.29_cuda12-archive.tar.xz&quot;<br>else<br>    DRIVE_URL=&quot;https://us.download.nvidia.com/tesla/535.104.05/NVIDIA-Linux-x86_64-535.104.05.run&quot;<br>    CUDA_SDK_URL=&quot;https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run&quot;<br>    CUDNN_ARCHIVE_URL=&quot;https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.5.29_cuda12-archive.tar.xz&quot;<br>fi<br>echo &quot;Setting up GPU...&quot;<br>DRIVER_NAME=&quot;NVIDIA-Linux-driver.run&quot;<br>wget -O &quot;$DRIVER_NAME&quot; &quot;$DRIVE_URL&quot;<br>TMPDIR=$LOCAL_TMP sh &quot;$DRIVER_NAME&quot; --disable-nouveau --silent<br>CUDA_SDK=&quot;cuda-linux.run&quot;<br>wget -O &quot;$CUDA_SDK&quot; &quot;$CUDA_SDK_URL&quot;<br>TMPDIR=$LOCAL_TMP sh &quot;$CUDA_SDK&quot; --silent --override --toolkit --samples --toolkitpath=$USR_LOCAL_PREFIX/cuda-12.2 --samplespath=$CUDA_HOME --no-opengl-libs<br>CUDNN_ARCHIVE=&quot;cudnn-linux.tar.xz&quot;<br>EXTRACT_PATH=&quot;$SRC_DIR/cudnn-extracted&quot;<br>mkdir -p &quot;$EXTRACT_PATH&quot;<br>wget -O &quot;$CUDNN_ARCHIVE&quot; &quot;$CUDNN_ARCHIVE_URL&quot;<br>tar -xJf &quot;$CUDNN_ARCHIVE&quot; -C &quot;$EXTRACT_PATH&quot;<br>CUDNN_INCLUDE=$(find &quot;$EXTRACT_PATH&quot; -type d -name &quot;include&quot; -print -quit)<br>CUDNN_LIB=$(find &quot;$EXTRACT_PATH&quot; -type d -name &quot;lib&quot; -print -quit)<br>cp -P &quot;$CUDNN_INCLUDE&quot;/* $CUDA_HOME/include/<br>cp -P &quot;$CUDNN_LIB&quot;/* $CUDA_HOME/lib64/<br>chmod a+r $CUDA_HOME/lib64/*<br>ldconfig</pre><p>By now, you should have a working system with an Nvidia device driver which can be checked by running nvidia-smi in the terminal.</p><h3>Install FFmpeg Prerequisites</h3><p>Before diving into FFmpeg’s installation, it’s crucial to understand and set up its dependencies, so FFmpeg can process most general process tasks for different formats and get an understanding of how to expand or limit the scope of FFmpeg for your multimedia task.</p><h4>System Dependencies</h4><p>FFmpeg is a great tool for text processing and text rendering in videos as well. To enable this feature, we will need to install libraries, that are used for text manipulation, embedding subtitles and other fancy operations like embedding the watermark of your brand in the video. These are essential system libraries that FFmpeg requires.</p><pre>dnf install -y freetype-devel fribidi-devel harfbuzz-devel fontconfig-devel bzip2-devel</pre><h4>Installing Audio &amp; Video Codecs</h4><p>At its core, FFmpeg functions like a versatile framework, ready to be extended with various plugins and modules. One of the primary ways this extensibility shines is through its support for many audio and video codecs. These codecs are the building blocks that allow FFmpeg to decode and encode media in various formats.</p><p>Now we will install different codecs, FFmpeg is like a template that is built in a way anyone can write a plugin like a video codec and that can be used with FFmpeg</p><ol><li><strong>ffnvcodec</strong>: Since the target instance is powered with GPU, ffnvcodec codec enables FFmpeg to leverage NVIDIA GPU acceleration, significantly speeding up video processing tasks for <strong>av1, H.264</strong> and <strong>HEVC</strong>/<strong>H.265</strong></li><li><strong>LIBASS</strong>: FFmpeg can use LIBASS for subtitle renderer to handle subtitles in various video formats.</li><li><strong>LIBAOM (AV1 Codec Library)</strong>: FFmpeg uses LIBAOM to decode and encode AV1 videos, if you want to use software transcoding for AV1.</li><li><strong>Other Codecs</strong>: These include libraries for various audio and video formats (e.g., libmp3lame for MP3 audio, opus for the Opus audio codec, and libogg for the Ogg container). In this build we will also enable software encoding of H.264 and HEVC/H.265 using x264 and x265 libraries .</li></ol><p>By ensuring all these prerequisites are installed and correctly set up, FFmpeg can provide its robust set of features, and users can harness the desired power out of this great utility.</p><h3>Installing FFmpeg</h3><p>Finally, we will compile GPU-accelerated FFmpeg from the source, with enabled support of all the codecs and libraries we have compiled or installed in previous steps.</p><pre>wget https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 &amp;&amp;<br>tar -jxf ffmpeg-snapshot.tar.bz2 &amp;&amp;<br>pushd ffmpeg &amp;&amp;<br>PKG_CONFIG_PATH=&quot;$USR_LOCAL_PREFIX/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:$USR_LOCAL_PREFIX/lib/pkgconfig&quot; \<br>    ./configure \<br>    --prefix=&quot;$USR_LOCAL_PREFIX&quot; --disable-static --enable-shared \<br>    --extra-cflags=&quot;-I$USR_LOCAL_PREFIX/include $NVIDIA_CFLAGS&quot; \<br>    --extra-ldflags=&quot;-L$USR_LOCAL_PREFIX/lib $NVIDIA_LDFLAGS&quot; \<br>    --extra-libs=&#39;-lpthread -lm&#39; --bindir=&quot;$USR_LOCAL_PREFIX/bin&quot; \<br>    --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac \<br>    --enable-libfreetype --enable-libmp3lame --enable-libopus \<br>    --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 \<br>    --enable-nonfree --enable-openssl $NVIDIA_FFMPEG_OPTS &amp;&amp;<br>make -j $CPUS &amp;&amp;<br>make install</pre><h3>Verifying GPU Acceleration Support in FFmpeg</h3><p>Once you’ve set up FFmpeg with GPU acceleration capabilities, it’s a good idea to ensure that it recognizes and can utilize the GPU for tasks like video encoding and decoding. The command below checks for the presence of NVIDIA’s NVENC (NVIDIA Video Encoder) in the list of supported codecs within FFmpeg:</p><pre>ffmpeg -hide_banner -codecs | grep nvenc</pre><p>If you see the output codecs with the nvenc label (e.g., h264_nvenc, hevc_nvenc, av1_nvenc), it indicates that FFmpeg has been correctly configured to support GPU-accelerated encoding for those specific codecs using NVIDIA&#39;s hardware.</p><h3>The Complete Script</h3><p>Building upon the various segments we’ve discussed, here’s the consolidated FFmpeg installation script along with the Nvidia GPU installation. This script has been thoroughly tested on <strong>Amazon Linux 2023</strong> and <strong>Ubuntu 22.04</strong> running on AWS G5g instances. It&#39;s not just limited to those; its flexibility is its strength. Whether you&#39;re on Debian, Red Hat, CentOS, Fedora, openSUSE, or even the sleek Alpine, this script is crafted to serve both <strong>ARM/aarch64</strong> and <strong>x86_64</strong> architectures seamlessly. Dive in and experience the universality of our FFmpeg installation script, bringing the power of multimedia to every corner of the Linux world.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d96ec2b7be3f8d848bc794d9350f825/href">https://medium.com/media/7d96ec2b7be3f8d848bc794d9350f825/href</a></iframe><h3>Hands-On: Converting H.264 to H.265 with GPU Acceleration</h3><p>In this section, we’ll take a hands-on approach to show you how to convert an H.264 encoded video to H.265 using the power of NVIDIA’s GPU acceleration. This way we can test the installation and experience the power of GPU acceleration in action. To perform this conversion, use the following command:</p><pre>ffmpeg -y -hide_banner -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -vf &quot;scale_cuda=720:480&quot; -c:v hevc_nvenc output.mp4</pre><p>In this command:</p><ul><li>-hwaccel cuvid and -c:v h264_cuvid uses GPU-based decoding of the H.264 video.</li><li>-vf &quot;scale_cuda=1920:1080&quot; scales the video using GPU acceleration.</li><li>-c:v hevc_nvenc instructs FFmpeg to encode the output video using the H.265 codec with NVIDIA&#39;s GPU acceleration.</li></ul><p>After executing the command, you’ll get output.mp4 an <strong>H.265</strong> 1080p encoded video.</p><h3>Conclusion</h3><p>By integrating FFmpeg with GPU hardware acceleration on AWS or any other infra-provider or architecture, you can optimize costs and reduce processing times, but it also future-proofs your workflow for higher-resolution media processing tasks down the line. By compiling from the source we are also addressing the outdated libraries and generalized package issues, which are not fully optimized for your architecture, as discussed in “<a href="https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source">How to install FFmpeg on Linux from source</a>” and some aspects are also discussed in the article <a href="https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix">“Why your AWS Deep learning AMI is Holding you back and how to fix</a> as well. The evolution of multimedia is ceaseless, but with tools like FFmpeg combined with AWS’s GPU prowess and cost-effectiveness, you are well-equipped to handle whatever challenges come next. Whether you’re a media company looking to scale or a hobbyist aiming for maximum efficiency, GPU-accelerated FFmpeg on AWS is a game-changer.</p><h3>Resources</h3><ul><li><a href="https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source#heading-why-compile-from-source">How-to install ffmpeg from source</a></li><li><a href="https://mirzabilal.com/deep-learning-with-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2-56d8457a6f6d">Deep-learning with AWS Graviton2 Nvidia Tensor T4g for as low as free</a></li><li><a href="https://mirzabilal.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix">Why your AWS deep-learning AMI is holding you back and how-to fix</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=109c07e70d2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install FFmpeg on Linux from Source]]></title>
            <link>https://mirzabilals.medium.com/how-to-install-ffmpeg-on-linux-from-source-4cd6fc012d39?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cd6fc012d39</guid>
            <category><![CDATA[compile-from-source]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[ffmpeg]]></category>
            <category><![CDATA[centos]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 22:16:04 GMT</pubDate>
            <atom:updated>2023-09-18T22:16:04.601Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tailoring your multimedia toolkit for best performance on Ubuntu, CentOS, RedHat, or any other Linux Distribution</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v4wzuEb1pXGaeHuP" /></figure><p>It was probably 2006 when I first heard about FFmpeg, and I was amazed by its capabilities. FFmpeg is a go-to solution for transcoding, and video manipulation, from trimming to burning the subtitles, adding a watermark, and more. Since FFmpeg was first launched, it has come a long way and has become the industry leader for multimedia workload for desktop apps, web, and especially on the backend.</p><p>In this article, we will discuss, Why you need to customize FFmpeg to match your requirements? and How you can compile FFmpeg from source along with various essential libraries and codes needed for video processing on different Linux distributions, from Ubuntu to Redhat based systems.</p><h3>Problem</h3><p>Installing FFmpeg directly from a Linux distribution’s default repositories may seem like a no-brainer, but this method is filled with potential drawbacks. For one, these repositories might not offer the most recent versions of FFmpeg and essential codecs or libraries, possibly exposing users to security risks and preventing them from accessing the latest features. Moreover, these default builds can be burdened with unnecessary codecs and libraries that many users may never use, or you might stranded in a scenario where the package has everything but does not come with the library you need.</p><p>But the challenges don’t stop here; in today’s diverse device ecosystem, which spans across ARM and x86_64 architectures, a one-size-fits-all build from the repository might not be optimized for a specific device with a specific <a href="https://en.wikipedia.org/wiki/Instruction_set_architecture">instruction set.</a> This is especially concerning for multimedia tasks that demand real-time processing, and you want to make the most out of the hardware you have.</p><p>Furthermore, for young developers or those new to the Linux landscape, crafting a custom FFmpeg build tailored to their requirements can be a daunting experience. The sea of options, configurations, and dependencies can be overwhelming, leading them to settle for suboptimal, generic builds rather than extracting the true potential of FFmpeg.</p><h3>Why Compile from Source?</h3><p>To overcome these problem for newbies to experts, the importance of comprehensive guides and resources to bridge the knowledge gap and empower the next generation of developers to confidently customize their multimedia tools. Following are the notable advantages for using source code as the starting point.</p><ol><li><strong>Customization</strong>: By compiling from source, you can choose the exact features and codecs you want, leading to a personalized FFmpeg build tailored to your needs.</li><li><strong>Smaller Footprint</strong>: When you include only the components you need, the resultant build will often be leaner and require less disk space.</li><li><strong>Access to the Latest Code</strong>: Official channels might not always have the latest version of FFmpeg. Compiling from source ensures you’re working with the most recent codebase.</li><li><strong>Performance Optimizations</strong>: Building from source can enable certain optimizations specific to your machine’s architecture and instruction set, potentially enhancing performance.</li><li><strong>Greater Learning Opportunity</strong>: Compiling software from source provides a deeper understanding of the software and its dependencies.</li></ol><h3>Installing Dependencies</h3><p>Before we jump into the installation process, it’s essential to set up our system with the necessary dependencies.</p><h4>On Ubuntu:</h4><pre>sudo apt update sudo apt install -y build-essential yasm cmake libtool libc6 libc6-dev unzip wget</pre><h4>On RedHat-based distributions:</h4><pre>sudo yum groupinstall &quot;Development Tools&quot; sudo yum install -y yasm cmake libtool unzip wget</pre><h3>Installing dependencies and codes:</h3><p>Once your build environment is set up, the next critical step is to install the various codecs and libraries that FFmpeg relies upon or that you wish to utilize for specific multimedia tasks. Remember, one of the key benefits of building from source is the ability to customize your FFmpeg installation, ensuring it’s streamlined to your needs, here you can pick and drop or even add codecs or libraries that you wish to use.</p><p>In the final script, we have provided a comprehensive list of dependencies and libraries, ensuring that you have a broad spectrum of multimedia capabilities at your fingertips.</p><h3>Installing FFmpeg</h3><p>You can obtain the latest source code from FFmpeg’s official website or use git:</p><pre>git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg cd ffmpeg</pre><h3>Configuration</h3><p>This step is crucial. The ./configure script allows you to select which features and codecs to include. For a basic setup, you can run:</p><pre>./configure \ --prefix=&quot;$USR_LOCAL_PREFIX&quot; \ --disable-static --enable-shared \ --extra-cflags=&quot;-I$USR_LOCAL_PREFIX/include $NVIDIA_CFLAGS&quot; \ --extra-ldflags=&quot;-L$USR_LOCAL_PREFIX/lib $NVIDIA_LDFLAGS&quot; \ --extra-libs=&#39;-lpthread -lm&#39; \ --bindir=&quot;$USR_LOCAL_PREFIX/bin&quot; \ --enable-gpl --enable-libaom --enable-libass \ --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \ --enable-libopus --enable-libvorbis --enable-libvpx \ --enable-libx264 --enable-libx265 --enable-nonfree \ --enable-openssl</pre><p>However, for a more customized setup, use flags like --enable-codec, --disable-codec, --enable-libx264, etc. Check ./configure --help for a full list of options.</p><h3>Compilation &amp; Installation</h3><p>Once configured, compile and install FFmpeg here:</p><pre>make -j$(nproc) sudo make install</pre><p>This will use all your CPU cores for the compilation (-j$(nproc)) and then install the software.</p><h3>Verification</h3><p>To verify your FFmpeg installation:</p><pre>ffmpeg -version</pre><h3>Wrap up &amp; the magic script:</h3><p>By now, you should have a basic understanding of how to customize FFmpeg. If so, that was our goal. If you have any confusion, leave a comment and I’ll be happy to discuss. To streamline everything and every step mentioned here, there’s a script for you to simply run, and it will handle the entire process.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4901bd62a287860da1977b0720b45321/href">https://medium.com/media/4901bd62a287860da1977b0720b45321/href</a></iframe><h3>Conclusion</h3><p>Now that we’ve gone through the process, I’m curious: Where do you plan to use your custom-tailored FFmpeg? Are you working on an innovative multimedia project, developing a web application, or just experimenting with video processing for personal use? FFmpeg’s versatility excels in a multitude of applications, from large-scale video platforms to hobbyist projects. Share your plans or current FFmpeg projects in the comments below. Let’s learn from one another and discover even more unique use cases for this powerful tool. Remember, the world of multimedia is vast, and with FFmpeg, the possibilities are endless.</p><p><em>Originally published at </em><a href="https://mirzabilal.com/how-to-install-ffmpeg-on-linux-from-source"><em>https://mirzabilal.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cd6fc012d39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Dark Side of High-Tech Success: Addressing Mental Well-being in Tech]]></title>
            <link>https://mirzabilals.medium.com/the-dark-side-of-high-tech-success-addressing-mental-well-being-in-tech-457861be7f67?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/457861be7f67</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[team-management]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 10:01:42 GMT</pubDate>
            <atom:updated>2023-09-13T10:01:42.888Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unraveling the underlying stress and creating a harmonious workplace for technology professionals.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJX3nG_rKBAz3FhpR09tIg.jpeg" /></figure><h3>Introduction</h3><p>In an era of rapid technological advancement, Software engineers and other IT professionals are in high demand. They might be earning good salaries but these lucrative financial opportunities do not come for free, and a hidden cost often goes unnoticed — the toll on their mental health. IT Professionals are facing mental health issues because of the intense work stress in this ever-demanding industry. In this article, we will build a case around the responsibilities and importance of the role of industry leaders and organizational leadership in addressing concerns related to the so-far neglected human side of the industry.</p><h3>The Wealth-Well-being Paradox</h3><p>The software developers and IT professionals are currently amongst the highly compensated in the job market. However, the seemingly attractive salaries can often obscure the challenging work environment, characterized by stress, long days and looming deadlines. This paradoxical situation raises significant concerns about the mental well-being of those working in this industry.</p><h3>Mental Health Issues in the Tech Industry</h3><p>The tech industry is notorious for its work culture that promotes continuous productivity and sacrifices personal well-being for the sake of meeting unrealistic targets at times. As a result, software developers and IT experts face a host of mental health challenges:</p><ol><li><strong>Burnout:</strong> This physical and emotional exhaustion due to a demanding work environment leads to burnout. Which affects an individual’s productivity, feelings of detachment, and diminished sense of personal achievement.</li><li><strong>Isolation:</strong> Long hours and remote work arrangements can lead to feelings of isolation, which can aggravate mental health concerns due to the lack of social interaction and result in loneliness and deteriorating mental health.</li><li><strong>Anxiety and Depression:</strong> The constant desire to perform at their best and the fear of being surpassed by peers weighed heavily on their minds. The stigma of being perceived as weak or incapable prevents employees from seeking assistance, exacerbating the condition.</li><li><strong>Imposter Syndrome:</strong> A lot of tech professionals feel like they’re not good enough or are under-achieving, even when they succeed. This feeling of “can do more”, increase anxiety and negatively impact self-esteem.</li></ol><h3>The Role of Industry Leaders</h3><p>Industry leaders and organizational leadership have a crucial role to play in addressing the mental health crisis amongst their subordinate and set an example for the industry to follow:</p><ol><li><strong>Championing Work-Life Balance:</strong> It’s essential for leaders to emphasize and devise a balanced work-life routine. By motivating staff to take regular breaks, use their holidays, and establish clear boundaries between work and personal time, they can significantly alleviate stress amongst the team.</li><li><strong>Work-Life Boundaries in Remote Settings:</strong> While offering flexible work arrangements like remote work and adaptable hours can help ease stress amongst professionals from tech sector, it’s vital to recognize and address the blurred lines between work and personal time that often come with remote work. Leaders should emphasis the importance of identifying and drawing clear boundaries to maintain a healthy work-life balance even when working from home.</li><li><strong>De-stigmatize Mental Health:</strong> Industry leaders should actively work to de-stigmatize mental health issues. Creating an open and supportive environment where employees feel comfortable discussing their struggles and seeking help is essential, and talking about mental health should not be considered a taboo.</li><li><strong>Mandatory Mental Health Sessions:</strong> Organizations should prioritize and invest in mental health support programs. Offering counseling services, stress management workshops, and other mental health resources is crucial. Employees should be required and even rewarded to attend these sessions to ensure they’re equipped to handle the pressures of their roles.</li><li><strong>Manage Workload:</strong> Leadership should assess and manage workloads to prevent burnout and avoid setting unrealistic goals and targets. Distributing tasks evenly, setting realistic deadlines, and avoiding excessive overtime can contribute to a healthier work environment.</li></ol><h3>Conclusion:</h3><p>The software development and IT sectors are lucrative, but they’re also tough on mental well-being. We can’t ignore the growing mental health strain that professionals in these areas are grappling with. It’s essential that industry bigwigs and company leaders genuinely listen and act. They need to foster a caring work environment, offer solid mental health support, and tear down the stigma around discussing mental challenges. Recognizing and acting on these issues is the only way to make sure our tech gurus aren’t just well-paid, but also mentally healthy and happy. After all, true success in the tech world should strike a balance between a good paycheck and peace of mind.</p><blockquote><em>“Almost everything will work again if you unplug it for a few minutes, including you.” </em><strong><em>— Anne Lamott</em></strong></blockquote><p>Unraveling the underlying stress and creating a harmonious workplace for technology professionals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=457861be7f67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Rockstars: Crafting the Team for Sustainable Success]]></title>
            <link>https://mirzabilals.medium.com/beyond-rockstars-crafting-the-team-for-sustainable-success-7acf8f08aa82?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/7acf8f08aa82</guid>
            <category><![CDATA[successful-business]]></category>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[team]]></category>
            <category><![CDATA[team-building]]></category>
            <category><![CDATA[sustainable-business]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Mon, 11 Sep 2023 08:31:47 GMT</pubDate>
            <atom:updated>2023-09-11T08:31:47.403Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Balanced approach to tech team dynamics for better execution and innovation.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9v7D_zO7l00w4ORYpWN27A.jpeg" /></figure><h3>Introduction</h3><p>If you possess prior experience working in industries such as technology or any other field, it is probable that you have encountered certain colloquialisms, such as “<strong>Ninjas</strong>,” “<strong>Wizards</strong>,” or “<strong>Rockstars</strong>.” These terms are used to identify exceptionalism. While having a team of such talented individuals can offer significant advantages and sound great on paper, building a team entirely of “Rockstars” in the real world may be counterproductive. I have worked for around 18 years, occupying various roles from Junior Software Developer to VP of Engineering.</p><p>Based on my good and bad experiences, I will explore why an ideal team isn’t made solely of <strong>Rockstars</strong> or just <strong>Doers</strong> but goes beyond individual members’ technical abilities. An efficient team requires a balanced mix of precisely calibrated and functioning components, much like a well-tuned automobile engine.</p><h3>The Rockstars Team: High-Octane But Unstable</h3><p>Imagine a car with a combustion engine made entirely of the most potent combustion cylinders. The concept sounds spectacular on paper — each cylinder, a Rockstar in its own right, promises to deliver unparalleled performance. However, in actuality, this engine would soon turn into a nightmare. The extreme power generated would be too much for any vehicle to handle, leading to an unstable, inefficient, and ultimately unworkable machine.</p><p>Similarly, a team full of ninjas may generate many brilliant ideas. Still, the risk of conflicting egos, misaligned objectives, and lack of focus on routine but necessary tasks could derail the team’s success.</p><h3>Drawbacks of a Rockstar-Only Team</h3><ol><li><strong><em>Conflicting Ideas:</em></strong> When everyone is a visionary, aligning the team to a common goal becomes challenging.</li><li><strong><em>Ego Clashes:</em></strong> Rockstars are accustomed to being in the spotlight, and having multiple such personalities in a team can lead to conflicts.</li><li><strong><em>Neglected Fundamentals:</em></strong> While everyone pursues the next big thing, routine but essential tasks that keep the project moving may be overlooked.</li></ol><h3>The Doers Team: Stable But Stagnant</h3><p>Let’s consider a car whose wheels are its only components. While wheels are essential for any vehicle to move, a car made only of wheels won’t have the power or functionality to go anywhere fast or effectively.</p><p>Likewise, a team of Doers might excel in day-to-day tasks and bring stability to a project. Yet, it may lack the creative spark and drive to innovate and evolve, which is essential for taking the next step in product growth.</p><h3>Drawbacks of a Doer-Only Team</h3><ol><li><strong><em>Lack of Innovation:</em></strong> Doers are excellent at following instructions but have little to no will or capacity to innovate.</li><li><strong><em>Dependency on Guidance: </em></strong>This type of team tends to be passive and waits for instructions instead of taking the initiative to solve problems independently.</li><li><strong><em>Resistance to Change:</em></strong> Such teams can resist adopting new methods or technologies, ultimately hindering progress.</li></ol><h3>The Perfect Recipe — Mixing Rockstars and Doers</h3><p>A balanced team comprises diverse skill sets, talents, and personalities. A perfectly designed car needs cylinders for power and wheels for movement. The perfect team needs both exceptional performers and diligent workers to function effectively.</p><h3>Components of a Mixed Team</h3><ol><li><strong><em>Domain-specific Rockstars:</em></strong> Depending on the size and nature of your organization, find a Rockstar or two for each crucial domain — be it front-end development, back-end architecture, or data science.</li><li><strong><em>Reliable Doers:</em></strong> Populate the rest of the team with Doers who excel in execution. They will be the ones to implement the vision set forth by the Rockstars.</li><li><strong><em>Interdisciplinary Understanding:</em></strong> Encourage mutual respect and understanding. Rockstars should appreciate the execution skills of Doers, and Doers should respect the vision of Rockstars.</li></ol><h3>Managing the Mix — The Role of Leadership</h3><p>As a leader, your role is to assemble this balanced team and ensure its components work harmoniously. Just like a car’s engine and wheels need a skilled driver at the helm, a mixed team needs strong leadership to steer it towards its objectives.</p><ol><li><strong><em>Setting Expectations:</em> </strong>Define roles and responsibilities and ensure everyone understands their specific and collective goals.</li><li><strong><em>Encouraging Collaboration: </em></strong>Facilitate open communication between Rockstars and Doers. Promote an environment where each can learn from the other.</li><li><strong><em>Monitoring and Tuning:</em></strong> Periodically review team performance. If the team is leaning too much toward innovation and venturing into impractical or unrealistic ideas at the expense of execution, or vice versa, recalibrate.</li></ol><h3>Conclusion</h3><p>In the quest for building a high-performing team, it’s easy to be seduced by the allure of stacking your team with exceptional individuals. While the potential for innovation and high performance is tempting, it’s crucial to remember that too much of a good thing can be harmful. Conversely, a team comprising executors may get the job done but could struggle with stagnation. Therefore, like a well-engineered car, a balanced mix of Rockstars for driving innovation and Doers for steady execution is often the most effective route to long-term success.</p><h3>What’s Next?</h3><p>So far, we’ve discussed the essential roles of Rockstars and Doers in a successful team. But what if there was another element — one that could make all the difference? Is your team truly complete? In our upcoming discussion, we will delve deeper into the composition of an ideal team and the importance of another element that will redefine how you approach team building.</p><p>Thank you for taking the time to read this article. Your interest and support are highly appreciated. I am eager to share more insights with you in the future. Please stay tuned for more updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7acf8f08aa82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your AWS Deep Learning AMI is Holding You Back and How to Fix]]></title>
            <link>https://mirzabilals.medium.com/why-your-aws-deep-learning-ami-is-holding-you-back-and-how-to-fix-3d0b35160e44?source=rss-fb609e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d0b35160e44</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ami]]></category>
            <dc:creator><![CDATA[Mirza Bilal]]></dc:creator>
            <pubDate>Sat, 09 Sep 2023 17:17:28 GMT</pubDate>
            <atom:updated>2023-09-09T17:17:28.436Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rUqX2QlUBm-dt3jMeCTmFg.png" /></figure><p>If you’re exploring your options for Deep Learning on AWS, you’ve likely considered using Deep Learning AMIs (Amazon Machine Images) to simplify your setup. Although pre-configured environments can be a good starting point, they have several limitations that will haunt you in the long run.</p><h3>The Bloatware Problem</h3><p>Deep Learning Amazon Machine Images (DLAMI) comes pre-installed with a plethora of applications, frameworks, and libraries. You will not need many of them in your production environment and sometimes not even in development.</p><h3>Outdated Drivers and Toolkits</h3><p>Your favorite deep learning framework released a new version that offers a valuable addition to your application. You are eager to start using it but unfortunately discover that your toolkit and drivers are outdated, dampening your enthusiasm. Now you’re locked into using older drivers, toolkits, and older framework and misses out on your favorite new feature of Deep Learning, which you were so excited about.</p><h3>Dependency Hell</h3><p>Installing required modules or libraries for your application can be challenging with these DLAMIs. You may encounter an issue where the module you are attempting to install requires version 2 of XYZ, but you only have version 1.5 installed. This issue should be resolved by simply updating XYZ. However, upon attempting that, you may find that another application or library, XYZ, depends on it. When you try to remove ABC, your application will never use it, but to your surprise, yet another application is dependent on it, and this chain of dependencies seems never-ending.</p><h3>Limited Architecture Support</h3><p>Suppose you want to leverage cost-effective instances like g5g.xlarge for deep learning inferences. In that case, you’re out of luck because no Deep Learning AMIs support them, or the only solution available has an older OS or outdated build tools. Especially for ARM-based instances, your choices are minimal. For Example, the only DLAMI available for the mentioned instance family is <a href="https://aws.amazon.com/marketplace/pp/prodview-wswmisyz3jiui">NVIDIA DLAMI</a>, built on top of Ubuntu 20.04.</p><h3>Solution</h3><p>Frustrated with these limitations myself, We’ve developed an automated, customizable script that can set up a high-performing deep learning environment on AWS EC2. This script downloads the latest Nvidia Drivers, CUDA 12.2, and cuDNN library. It uses the latest Amazon Linux 2023 as its base AMI. It offers several advantages, including support for the latest Linux Kernel 6 and more recent versions of GCC and other build tools and utilities. This script clones PyTorch and compiles it from the source to ensure you have the proper CUDA device support.</p><h3>Performance and Cost Benefits</h3><p>The customization allows for a lean, performance-optimized setup with a minimal footprint.</p><p>As in this script, PyTorch is compiled from source after cloning it from the official repository. It offers advantages like hardware-specific optimization and the use of up-to-date code. Hence resulting in better performance and security as compared to pre-built Pytorch.</p><p>And if your compute tasks can tolerate interruptions or you can design your application with failover tolerance in mind, you can take advantage of spot instances, which are incredibly cost-effective at as low as $0.152 per hour these days.</p><h3>Want the Full Guide? Dive In Here!</h3><p>For a comprehensive step-by-step guide addressing these problems and access to this game-changing script, check out our complete guide at <a href="https://jumpshare.com/blog/deep-learning-on-aws-graviton2-nvidia-tensor-t4g-for-as-low-as-free-with-cuda-12-2/">Jumpshare Blog</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d0b35160e44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>