Always run wsl --update first.
Also make sure to run Windows update + make sure all GPU drivers are up to date (google $(GPU_NAME) update treiber windows).
Install OpenSuse tumbleweed via appstore. Then:
sudo zypper refresh
sudo zypper update
| using WGLMakie, Bonito | |
| MSGS = Dict() | |
| function run_example!(figfunc, name, testfunc) | |
| f, ax, pl = figfunc() | |
| display(f) | |
| _testfunc() = begin | |
| testfunc(f, ax, pl) | |
| if isdefined(WGLMakie, :poll_all_plots) | |
| WGLMakie.poll_all_plots(f.scene) |
| ARG IMAGE=nvidia/cuda:12.1.1-devel-ubuntu22.04 | |
| FROM $IMAGE | |
| ARG JULIA_RELEASE=1.9 | |
| ARG JULIA_VERSION=1.9.4 | |
| # julia | |
| RUN apt-get update && \ | |
| DEBIAN_FRONTEND=noninteractive \ |
| using Preferences | |
| for uuid in ["ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a", "e9467ef8-e4e7-5192-8a1a-b1aee30e663a", | |
| "276b4fcb-3e11-5398-bf8b-a0c2d153d008", "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"] | |
| set_preferences!(Base.UUID(uuid), "precompile_workload" => false; force=true) | |
| end |
| # Super simple SIMD implementation for Complex Numbers | |
| struct ComplexSIMD{N,T} | |
| re::NTuple{N,T} | |
| im::NTuple{N,T} | |
| end | |
| Base.abs2(z::ComplexSIMD) = z.re .* z.re .+ z.im .* z.im | |
| Base.:(*)(a::ComplexSIMD, b::ComplexSIMD) = ComplexSIMD(a.re .* b.re .- a.im .* b.im, a.re .* b.im .+ a.im .* b.re) | |
| Base.:(+)(a::ComplexSIMD, b::ComplexSIMD) = ComplexSIMD(a.re .+ b.re, a.im .+ b.im) | |
| function mandelbrot_kernel(c::ComplexSIMD{N,T}) where {N,T} |
| using Mmap, TextParse | |
| using TextParse: Record, Field, Numeric, tryparsenext, isnull | |
| struct MMapString{T} <: AbstractVector{Char} | |
| x::T | |
| end | |
| MMapString(path::String) = MMapString(Mmap.mmap(open(path), Vector{UInt8})) | |
| # we only need to overload the iteration protocol for TextParse to work! | |
| Base.Base.@propagate_inbounds Base.getindex(x::MMapString, i) = Char(x.x[i]) | |
| Base.Base.@propagate_inbounds function Base.iterate(x::MMapString, state...) |
julia --project=. -e "using Pkg; pkg"add RadeonProRender#sd/moah GeometryBasics [email protected]"
executed with:
julia --project=. --check-bounds=(yes|no) rpr_mwe.jl
Diff of the llvm code: https://www.diffchecker.com/chE5Jtim
| using FFMPEG | |
| function save(src::String, out::String; | |
| framerate::Int = 24, compression = 20) | |
| typ = splitext(out)[2] | |
| mktempdir() do dir | |
| if typ == ".mp4" | |
| ffmpeg_exe(`-i $(src) -crf $compression -c:v libx264 -preset slow -r $framerate -pix_fmt yuv420p -c:a libvo_aacenc -b:a 128k -y $out`) | |
| elseif typ == ".webm" | |
| ffmpeg_exe(`-i $(src) -crf $compression -c:v libvpx-vp9 -threads 16 -b:v 2000k -c:a libvorbis -threads 16 -r $framerate -vf scale=iw:ih -y $out`) | |
| elseif typ == ".gif" |
| using StructArrays | |
| using BenchmarkTools | |
| using LoopVectorization | |
| function juliaset2(re, im, c, maxiter) | |
| result = re % UInt8 | |
| for i in 1:maxiter | |
| abs = re*re + im*im | |
| mask = abs > 4f0 | |
| result = mask & ((i - 1) % UInt8) |
| using Hyperscript, Markdown | |
| using JSServe, Observables | |
| using JSServe: Session, evaljs, linkjs, div, active_sessions | |
| using JSServe: @js_str, onjs, Button, TextField, Slider, JSString, Dependency, Asset | |
| using WGLMakie, AbstractPlotting | |
| markdown_css = Asset(JSServe.dependency_path("markdown.css")) | |
| function test_handler(session, req) | |
| button = Button("click") |