Monday 27 May 2024

Guide to Asahi Linux Fedora running Steam | microVM

Introduction

I heard about Asahi Linux back in the early days and became one of its followers/supporters.  I believe having the arm ecosystem and an option to run linux on mac systems a must first step in many developments including fully adapability in an newer architecture.  This guide is for owners of M1 or M2 macs running fedora linux 40 in order to run steam games.

For the past little while I have been diving into this Linux stack trying to replicate the rumored steam installation and running of various games on Fedora Linux on a mac. The source of this material is from slp's blog and also Rob Clark’s XDC 2022 talk about Virtgpu DRM native context, a novel technique that brings close-to-native GPU performance to VMs.

The problem with Asahi Linux is a paging size problem in running steam which requires 4k pages while the operating system uses 16k pages.  The x86_64 games on steam runs on 4k size pages.  Understand the experimental nature of doing this. Do not bug the Asahi Liux Developers about this.  This guide can break at any time. It is working as of May 2024.

The Guide

Install Fedora Remix 40

https://asahilinux.org/fedora/

Install Distrobox

sudo dnf copr enable alciregi/distrobox

sudo dnf install distrobox

Use distrobox to create image

    export DBX_CONTAINER_MANAGER=podman
    distrobox create --image quay.io/fedora/fedora-toolbox:40-aarch64 --name asahi-krun --volume ~/.config/pulse


Enter Distrobox

    distrobox enter asahi-krun

When ready your prompt should look like this [username@asahi-krun ~]$

Install krun and dependencies inside the container

sudo dnf copr enable slp/asahi-mesa-wip
sudo dnf copr enable teohhanhui/asahi-krun
sudo dnf --best install alsa-lib alsa-plugins-pulseaudio alsa-utils dhclient eglinfo glmark2 glx-utils libkrun mesa-demos mesa-dri-drivers passt pipewire-libs pulseaudio pulseaudio-libs pulseaudio-utils sommelier virglrenderer xorg-x11-server-Xwayland --exclude pipewire
cd ~/Downloads
git clone https://github.com/slp/krun.git
cd krun
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. ~/.cargo/env
sudo dnf group install c-development
sudo dnf install clang-devel libkrun-devel llvm-devel
cargo build --release
sudo cp target/release/krun{,-guest} /usr/local/bin/
sudo chmod +x /usr/local/bin/krun{,-guest}
sudo chown -R $USER: ~/.config/pulse

Save the krun file from this gist as ~/.local/bin/krun, then chmod +x ~/.local/bin/krun. This will be your entry point to run anything inside krun VM.

krun

Thursday 12 May 2022

What I learned from Project 1 of Udacity's Data Science with Python bootcamp

Introduction

As part of the project I completed successfully, I used SQL to explore a database related to movie rentals. SQL queries was ran and visualizations built to showcase the output in pdf. With my prior knowledge of SQL I learned at Seneca, I was able to complete this section in a day (3 weeks worth of work). I did this on my own time while I am on my work term with City of Toronto.

Page 1:

Page 2:


Page 3:


Page 4:



    For issues with plagerism, I won't show my code at this time.  However, I may post what I have for my next project which is a python bike sharing application.  The final project just has to do with Git and source control so I should be fine.  I was impressed to learn the different options in git log and my horizons expanded as I honed in on my skills with github and git.

Kind Regards,
Eugene Chung



Thursday 9 December 2021

Thoughts on OSD600 course from my perspective

Introduction 

Throughout my three month plus journey, I have fought, I have struggled and I have conquered Git and Github workflow in projects related our individual SSG project, large open source projects like Microsoft Quantum and Manim, internal projects like Telescope and IPC144 and smaller projects like Cchess.  I no longer have fear of using source control as compared to at the start of the term. At present, I can contribute to any open source project without the need to worry if I make can proper, clean commits.  This is a unique course in Ontario where students have the opportunity to work on any open source projects around the world, in any programming language, in any written language and without major restrictions that hold you back from accomplishing and achieving our potential.

Some of the highlights of this course include coding in multiple languages, having touched many aspects of code as well as collaborated with students going through the course.  I believe Online learning for this course is unique and being asynchronous format helps students who are busy with family, Covid-19 struggles, part time work to really manage our time and learn at our own pace.  It is true the effort you put in this course is what you get out of it in the end.  It was also interesting to read other fellow student's blog posts as well as the communication in Slack, although not visible at times is a place where we can help each other.  The collaborative nature of this course is what inspired me to continue my diploma at Seneca.

Advice for Future OSD600 students

If you want to do well in the course, I suggest to start early and learn to find open source projects you are interested in.  There is no one to tell you what you can do but you have to find the issues yourself, which can be the greatest strength and weakness depending on your motivation.  I find if you try your best, it really shows in your commits and the care you put into your work.  Dave is not asking you to do everything perfectly, but he is asking you to improve little by little throughout the weeks.  The course is designed so that your skills can be honed in many areas.  I particularly enjoyed the week on rebasing and merging commits because it shows how powerful Git really is, because with great power comes great responsibility.   Where most students struggle at first is using Git and doing things properly.  For instance, Dave teaches NOT git add .  , because you shouldn't add everything and you need to be specific and not lazy.  If you make mistakes its alright, but do learn from it.  Being successful in OSD600 comes down to planning your weeks and starting ahead of time.  I know students tend to wait till the end because deadlines are not hard but you should not get into the habit of completing labs in the last minute.  Its the same as on the job and in life.

Conclusion

I definitely recommend this course to anyone willing to become a better programmer.  It is definitely one of the highlights of my Seneca student career.  What you learn here is invaluable to anyone moving to full time employment in the future, because it builds your exposure and Github profile.  Employers take notice of the work students contribute and commit in this course, and if anything do it to learn Git.   Reading how to do it and watching Youtube videos is not going automatically give you the skills you need to know Git and Github, you need to practice it constantly in the course.  Dave is always here to guide you if your stuck and its the only way you can learn and overcome it by asking questions.  Thank you for reading.

Merry Christmas and Happy New Year
Eugene Chung

Wednesday 8 December 2021

Release 0.4 #3 - Release

Introduction

This is the last blog to my release 0.4 for OSD600. I was not overly ambitious as my previous releases in order to set myself to succeed.  This post will be on what I have completed and what I tried doing.

Implementation

 For my main issues for AOC repository, I completed days one to five as expected and also day seven is done but I did not push my code yet.  I will do so at the end of the week to give others a chance to come up with the solution.  What gave me most trouble was day six, because if you do not setup the program correctly in order to do exponential growth of input, you will run out of memory.  I thought of using hash tables to instead allocating blocks of memory to over come this problem, but have yet to written it properly in python.  Days three and four took the longest time because i had to review my data science knowledge.

The following is my progression up to day seven to represent the week of work I did.

 

As mentioned in my previous posts, I finished the changes for my translation as per request by reviewer.

The following is the running website image of my pull request for the prompts-ai repository.

 

 Unfortunately I did not dive far enough in the Telescope issues and they are not completed for release 0.4.  I will look into working more with open source projects in the future as the new year begins soon.  Things that I would have done differently is look at more issues on Github to get a better grasp of the things ahead as I did not know I will be continuously looking for issues during the course of this semester.


God Bless,

Eugene Chung

Xbox Kernel Code Execution in SystemOS POC Explained 2024/06

 In the Xbox wiki  code execution via Game Script UWP App, it is available currently in Microsoft store which allows the writing and executi...