新規登録 ログイン
n/open-source · 6か月前 · 編集済み · 2822 回閲覧
u/fat3264名誉メンバーダイヤモンド
n/open-sourceu/fat3264 · 6か月前

Nvidia 自动开机参考资料

前提条件:通过 https://dsx-air.nvidia.com/ 注册并成功申请到试用资格,且创建好simulations

先打开 https://dsx-air.nvidia.com/simulations 找到自己的simulationsID
例如:nodeloce-7dec-11d0-a765-00a0cnodeloc

然后在登录状态下,打开F12,直接在Console里粘贴如下代码(自行修改sid和URL前缀)
另外可能脚本中dsx-air前缀不一定是最新的,如有新的则替换成新的(比如air-ngc)

[upvote]

if (window._sMonitor?.isActive) {
  window._sMonitor.destroy();
}

class SMonitor {
  #sid = "nodeloce-7dec-11d0-a765-00a0cnodeloc"; //自己的simulationsID
  #intervalMs = 3000; //任务间隔 毫秒数
  #abortController = null;
  #timerId = null;

  constructor() {
    this.isActive = true;
    this.#initLoop();
  }

  get #requestConfig() {
    return {
      method: "PATCH",
      mode: "cors",
      credentials: "include",
      referrer: `https://dsx-air.nvidia.com/simulations/${this.#sid}`,
      headers: {
        "accept": "application/json, text/plain, */*",
        "cache-control": "no-cache",
        "pragma": "no-cache"
      }
    };
  }

  async #pingState() {
    const timestamp = () => `[${new Date().toLocaleTimeString()}]`;
    const url = `https://api.dsx-air.nvidia.com/api/v3/simulations/${this.#sid}/start/`;

    try {
      const response = await fetch(url, {
        ...this.#requestConfig,
        signal: this.#abortController?.signal
      });

      const rawText = await response.text();
      let parsedData;
      
      try {
        parsedData = JSON.parse(rawText);
      } catch {
        parsedData = rawText;
      }

      if (parsedData && typeof parsedData === 'object' && 'state' in parsedData) {
        console.log(`${timestamp()} State:`, parsedData.state);
      } else {
        console.log(`${timestamp()} Raw Response:`, parsedData);
      }

      if (!response.ok) {
        console.log(`${timestamp()} HTTP Error:`, response.status);
      }

    } catch (err) {
        console.log(`${timestamp()} Network/Request Failed:`, err);
    }
  }

  #initLoop() {
    this.#abortController = new AbortController();
    
    const tick = async () => {
      if (!this.isActive) return;
      await this.#pingState();
      if (this.isActive) {
        this.#timerId = setTimeout(tick, this.#intervalMs);
      }
    };

    tick();
  }

  destroy() {
    this.isActive = false;
    if (this.#timerId) clearTimeout(this.#timerId);
    if (this.#abortController) this.#abortController.abort();
    console.log("stopped and cleaned up.");
  }
}

window._sMonitor = new SMonitor();

[/upvote]

只要代码开始运行了就不要再操作这个网站了以防止自动退出登录,再之后出现任何错误都不用理会。
只要返回如下类似内容,就表示代码正常运行了。

HTTP Error: 400
HTTP Error: 403
State: REQUESTING

PS:如果申请试用资格失败的话,貌似换个IP再刷新页面有机率申请成功!

Good luck to all

34
165
ログインすると議論に参加できます。

返信 165 件

並び順
  1. GeorgeXie 💬 マスター 離れず、見捨てず 6か月前

    厉害了大佬

    3
  2. BearPaw マスター 6か月前

    我还要等吗???:xhj19:

    3
  3. wboo シルバー 6か月前

    支持一个,还没有开出来

    2
  4. liuhaha ゴールド 2年間 6か月前

    学习一下

    2
  5. BearPaw マスター 6か月前

    看看,感谢大佬

    2
  6. eooce 名誉メンバー ダイヤモンド 達人 6か月前

    顶配就位

    2
  7. James 💯 レジェンド マネージャー 6か月前

    怎么还能DD win,太牛逼了

    0
  8. supers アンライバルド マスターメンバー 6か月前

    早玩过了,哈哈。

    0
  9. zhoujia 大富豪 ダイヤモンド 国一つ買えるほどの大富豪 6か月前

    试试

    1
  10. AlteremLiu 💭 ダイヤモンド 6か月前

    期待我的好消息

    1
  11. zhoujia 大富豪 ダイヤモンド 国一つ買えるほどの大富豪 6か月前

    小鸡其实已经更新好了,但没法开机 :xhj001:

    1
  12. hakd マスター 2年間 6か月前

    反正我是开不出机器来。
    只能看看了。

    1
  13. zhizhang31415926-ops シルバー 6か月前

    试一下能不能开,手动开不了

    1
  14. zhongting ゴールド 6か月前

    看看

    1
  15. jhon_xin ゴールド 6か月前

    感谢大佬

    1
  16. hankswang01 ゴールド 離れず、見捨てない 6か月前

    谢谢大佬

    1
  17. biubiuball ゴールド 6か月前

    不错的内容,Mark

    1
  18. zbigbird シルバー 6か月前

    学习一下

    1
  19. linxone2895 ゴールド 6か月前

    支持一个!

    1
  20. Pua シルバー 3年 6か月前

    来晚了啊,没有资格了

    0
  21. acwea904 ゴールド 3年 6か月前

    支持一个

    0
  22. sdcfre ダイヤモンド 3年 6か月前

    看看

    0
  23. eryingzhang ゴールド 6か月前

    正需要 看看

    0
  24. reidentify シルバー 6か月前

    支持一下。感谢分享

    0
  25. AlteremLiu 💭 ダイヤモンド 6か月前

    我看看

    0
  26. eryingzhang ゴールド 6か月前

    simulationsID 在哪个位置,大佬帮忙截个图 谢谢

    0
  27. AlteremLiu 💭 ダイヤモンド 6か月前
    1
  28. Jessadmin シルバー 3年 6か月前

    学习学习

    0
  29. techthink シルバー 6か月前

    感谢大佬,膜拜

    0
  30. Lazy シルバー 3年間 6か月前

    厉害了

    0
  31. lo_Yuki シルバー 6か月前

    看看怎么样

    0
  32. mansel シルバー 6か月前

    看一看

    0
  33. yellowbins ゴールド 3年 6か月前

    支持一个

    0