Category: Essays

  • Compiling PBRT v3, v4 and Mitsuba 3 on macOS and Linux (English)

    PBRT Getting Started

    https://github.com/mmp/pbrt-v3

    https://github.com/mmp/pbrt-v4

    To compile PBRT v3, run the following commands:

    git clone --recursive https://github.com/mmp/pbrt-v3/
    cd pbrt-v3
    mkdir build
    cd build
    cmake ../
    make -j
    Bash

    To compile PBRT v4, run the following commands:

    git clone --recursive https://github.com/mmp/pbrt-v4/
    cd pbrt-v4
    mkdir build
    cd build
    cmake ../
    make -j
    Bash

    (Options) After compiling both versions, you can create symbols links for easier access from terminal.

    sudo ln -s /[your-pbrt-v4-PATH]/build/pbrt /usr/local/bin/pbrt4
    sudo ln -s /[your-pbrt-v3-PATH]/build/pbrt /usr/local/bin/pbrt3
    Bash

    Notice: You need to change the PATH above.

    If you wanna delete the links, type:

    sudo rm /usr/local/bin/pbrt4
    sudo rm /usr/local/bin/pbrt3
    Bash

    Some Problem when building pbrt-v4 cmake files:

    Error Log:

    Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
    OPENGL_INCLUDE_DIR)
    Call Stack (most recent call first):

    You need to download the OpenGL Lib:

    sudo apt update
    sudo apt install -y \
        mesa-utils \
        libgl1-mesa-dev \
        libglu1-mesa-dev \
        freeglut3-dev \
        xorg-dev
    Bash

    Error Log:

    CMake Error at src/ext/glfw/src/CMakeLists.txt:76 (message):
    Failed to find wayland-scanner

    Lack wayland-scanner tool when cmake building GLFW, run following command:

    sudo apt update
    sudo apt install -y \
        wayland-protocols \
        libwayland-dev
    Bash

    Error Log:

    CMake Error at /home/linuxbrew/.linuxbrew/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
    The following required packages were not found:

    • xkbcommon>=0.5.0

    Need download Wayland:

    sudo apt update
    sudo apt install -y \
        libxkbcommon-dev
    Bash

    Warnning Log:

    CMake Warning at CMakeLists.txt:200 (message):
    Found CUDA but PBRT_OPTIX7_PATH is not set. Disabling GPU compilation.

    Optix doesn't support WSL2 yet.

    Go optix link , download the file.

    Maybe you got the file named: “NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64-35015278.sh”. (Change the name Remember)

    Then, ensure the .sh file has executable permissions:

    chmod +x NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64-35015278.sh
    Bash

    Execute the installer script:

    sudo ./NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64-35015278.sh
    Bash

    press y to accept the license:

    Log:

    Do you accept the license? [yn]:
    y
    By default the NVIDIA OptiX will be installed in:
    "/home/remo-wsl/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
    Do you want to include the subdirectory NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64?
    Saying no will install in: “/home/remo-wsl” [Yn]:
    y

    Using target directory: /home/remo-wsl/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64
    Extracting, please wait…

    Unpacking finished successfully

    Set the Environment Variable After Installation (Remember Change The File Name) :

    export PBRT_OPTIX7_PATH=/home/remo-wsl/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64
    Bash

    To make it permanent, add it to your .bashrc:

    echo 'export PBRT_OPTIX7_PATH=/home/remo-wsl/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64' >> ~/.bashrc
    source ~/.bashrc
    Bash

    Finally, back to the pbrt-v4 PATH:

    rm -rf build
    mkdir build
    cd build
    cmake .. -DPBRT_OPTIX7_PATH=/home/remo-wsl/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64
    make -j$(nproc)
    Bash

    Mitsuba 3 Getting Started

    https://www.mitsuba-renderer.org

    Requirements

    • Python >= 3.8
    • (optional) For computation on the GPU: NVidia driver >= 495.89
    • (optional) For vectorized / parallel computation on the CPU: LLVM >= 11.1

    The following command leads you to intall both Mitsuba 3 and JIT (If your system not already available. )

    pip install mitsuba
    Bash

  • wsl: localhost proxy configuration detected but not mirrored to WSL. WSL in NAT mode does not support localhost proxy.

    link to: https://github.com/microsoft/WSL/releases/tag/2.0.0

    Windows 11 24H2

    1. Open or create the wsl configuration file (located at %USERPROFILE%\.wslconfig ), and enter the following content:

    [experimental]
    autoMemoryReclaim=teacher | dropcache | disabled
    networkingMode=mirrored
    dnsTunneling=true
    firewall=true
    autoProxy=true
    Bash

    2. Open the command prompt and execute wsl --shutdown

  • pbrt-v4 build on windows 11 cmake generation requires target “zlibstatic” that is not in any export set. (English)

    link same issue: https://github.com/mmp/pbrt-v4/issues/467

    My Env:

    • Win11 24H2
    • AMD Ryzen 9 5900X 12-Core Processor
    • Microsoft Visual Studio Community 2022 17.12.3
    • VisualStudio.17.Release/17.12.3+35527.113
    • Microsoft .NET Framework 4.8.09032
    • Visual C++ 2022 00482-90000-00000-AA244
    • Microsoft Visual C++ 2022

    Log:

    1> [CMake] CMake Error: install(EXPORT “Ptex” …) includes target “Ptex_static” which requires target “zlibstatic” that is not in any export set.
    1> [CMake] — Generating done (0.2s)
    1> [CMake] CMake Generate step failed. Build files cannot be regenerated correctly.

    Place the following file to pbrt4 dir and double click to compile.

    Then cd ./build/pbrt4deploy -> ./pbrt

    Log:

    PS G:\pbrt\pbrt-v4\pbrt-v4\build\pbrt4deploy\bin> ./pbrt
    pbrt version 4 (built Jan 6 2025 at 21:39:19)
    Copyright (c)1998-2021 Matt Pharr, Wenzel Jakob, and Greg Humphreys.
    The source code to pbrt (but not the book contents) is covered by the Apache 2.0 License.
    See the file LICENSE.txt for the conditions of the license.

    Then maybe you will get the following Warning:

    link to: https://www.janwalter.org/rnd/blog/rnd-pbrt-v4-002/

    Log:

    Found CUDA but PBRT_OPTIX7_PATH is not set. Disabling GPU compilation

    Make sure that the SDK Path is correct. (-DPBRT_OPTIX7_PATH)

  • Finally Fix my PC (English)

    Finally Fix my PC (English)

    5900x + 3070, yes in 2025…

    Change my 3700x to 5900x. Cuz my b450 didn't work, so I have to bought a new motherboard. Finally, I chose the B550 + 5900X (79 USD + 163 USD) as a transition for the new product (Yes, 9950x3d).

  • Article Share – 2025.1.6 (English)

    Article Share – 2025.1.6 (English)

    How To Ask Questions The Smart Way

    http://www.catb.org/~esr/faqs/smart-questions.html

    In the world of hackers, the kind of answers you get to your technical questions depends as much on the way you ask the questions as on the difficulty of developing the answer. This guide will teach you how to ask questions in a way more likely to get you a satisfactory answer .

    Now that use of open source has become widespread, you can often get as good answers from other, more experienced users as from hackers. This is a Good Thing; users tend to be just a little bit more tolerant of the kind of failures newbies often have. Still, treating experienced users like hackers in the ways we recommend here will generally be the most effective way to get useful answers out of them, too.

    The first thing to understand is that hackers actually like hard problems and good, thought-provoking questions about them. If we didn't, we wouldn't be here. If you give us an interesting question to chew on we'll be grateful to you; good questions are a stimulus and a gift. Good questions help us develop our understanding, and often reveal problems we might not have noticed or thought about otherwise. Among hackers, “Good question!” is a strong and sincere compliment.

    Despite this, hackers have a reputation for meeting simple questions with what looks like hostility or arrogance. It sometimes looks like we're reflexively rude to newbies and the ignorant. But this isn't really true.

    What we are, unapologetically, is hostile to people who seem to be unwilling to think or to do their own homework before asking questions. People like that are time sinks — they take without giving back, and they waste time we could have spent on another question more interesting and another person more worthy of an answer. We call people like this “losers” (and for historical reasons we sometimes spell it “lusers”).

    We realize that there are many people who just want to use the software we write, and who have no interest in learning technical details. For most people, a computer is merely a tool, a means to an end; they have more important things to do and lives to live. We acknowledge that, and don't expect everyone to take an interest in the technical matters that fascinate us. Nevertheless, our style of answering questions is tuned for people who do take such an interest and are willing to be active participants in problem-solving. That's not going to change. Nor should it; if it did, we would become less effective at the things we do best.

    We're (largely) volunteers. We take time out of busy lives to answer questions, and at times we're overwhelmed with them. So we filter ruthlessly. In particular, we throw away questions from people who appear to be losers in order to spend our question-answering time more efficiently, on winners.

    If you find this attitude obnoxious, condescending, or arrogant, check your assumptions. We're not asking you to genuflect to us — in fact, most of us would love nothing more than to deal with you as an equal and welcome you into our culture, if you put in the effort required to make that possible. But it's simply not efficient for us to try to help people who are not willing to help themselves. It's OK to be ignorant; it's not OK to play stupid.

    So, while it isn't necessary to already be technically competent to get attention from us, it is necessary to demonstrate the kind of attitude that leads to competence — alert, thoughtful, observant, willing to be an active partner in developing a solution. If you can't live with this sort of discrimination, we suggest you pay somebody for a commercial support contract instead of asking hackers to personally donate help to you.

    If you decide to come to us for help, you don't want to be one of the losers. You don't want to seem like one, either. The best way to get a rapid and responsive answer is to ask it like a person with smarts, confidence, and clues who just happens to need help on one particular problem.

    (Improvements to this guide are welcome. You can mail suggestions to esr@thyrsus.com or respond-auto@linuxmafia.com. Note however that this document is not intended to be a general guide to netiquette, and we will generally reject suggestions that are not specifically related to eliciting useful answers in a technical forum.)

  • 人生有什么最幸福的瞬间?

    What is the happiest moment in life?

    Many times, I thought that this day was just another ordinary day.

    Only years later do you realize that this was actually the best day of your life.

    And there will never be such a time again.

    It was a summer afternoon many years ago, when I was still in middle school.

    I neither went home nor took a nap at school, but went to the garden in the neighborhood next door.

    Lying on a stone chair.

    It was quiet all around, with only the occasional chirping of birds. I just lay there quietly.

    Until the lunch break was over, I returned to school with my friends.

    Life is like this, the best times usually slip away quietly without you noticing.

    Suddenly looking back, I found that happiness had already passed by.

    Only then did I realize that the warmth had quietly disappeared.

  • 随记 2024 圣诞

    Notes on Christmas 2024

    I was slacking off on Christmas afternoon. I was studying in a cafe with my old friend A.

    Officially started writing a paper template based on typst.

    Since I didn't know much about typst before, I read the graduate student template of Sun Yat-sen University in detail and decided to start by copying it.

    I worked with a friend from my undergraduate program. We worked all afternoon to replicate the layout of the first and second pages.

    But it can only be said that the code structure is quite simple and has zero scalability.

    But I can’t care about so many things. Being able to run is victory, and the rest can be discussed later.

    That night, I went to Xiaobei with my old friend A to eat barbecue.

    Walking down the long corridor, everything seemed familiar.

    Every time I suggest coming here to eat barbecue, and every time after eating, I say that this place has a poor value for money and I won’t come here again.

    After eating, I burped all the way. For the first time in my life, I walked from Xiaobei back to Yangji.

    Of course, after wandering around for quite a while, I didn’t get home until after eleven o’clock.

    The next day, I was still working on the typst template, from the afternoon until 3:30 in the morning. Finally, I finished it and put it on GitHub.

    https://github.com/Remyuu/thesis-typst-cn

    My friend asked me why I worked so hard. I smiled.

    It's ridiculous that life is so bad that I am addicted to the sense of order and regularity that electronic typesetting brings me.

    Friday is also a busy day.

    I came home, played some games, prepared the emails I needed to send tomorrow, and finally wrote this diary while lying on the bed.

    I have to say, the past six months have been a mess. A lot has changed, but no one can see it.

    come on.

en_USEN