Your way seems to  be working correctly but I will have to do better experiments tomorrow using various computers/hardware setup to make sure.  Lots more tests to do.  Below is how I added line to main.C.
        batch_path[0] = 0;
        deamon_path[0] = 0;
        Units::init();
        setenv("LIBVA_DRIVERS_PATH","/usr/lib/dri:/usr/lib64/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/aarch64-linux-gnu/dri",1);
        const char *lang = getenv("LANGUAGE");