diff --git a/jupyterhub_config.py b/jupyterhub_config.py index 74885fd..10fba88 100644 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -39,7 +39,7 @@ c.DockerSpawner.remove = True c.DockerSpawner.debug = True # User containers will access hub by container name on the Docker network -c.JupyterHub.hub_ip = "jupyterhub" +c.JupyterHub.hub_ip = 'jupyterhub' c.JupyterHub.hub_port = 8080 # Persist hub data on volume mounted inside container @@ -55,4 +55,13 @@ c.NativeAuthenticator.open_signup = True # Allowed admins admin = os.environ.get("JUPYTERHUB_ADMIN") if admin: - c.Authenticator.admin_users = [admin] \ No newline at end of file + c.Authenticator.admin_users = [admin] + +# GPU 和网络配置 +c.DockerSpawner.extra_host_config = { + 'runtime': 'nvidia' +} +c.DockerSpawner.environment = { + 'NVIDIA_DRIVER_CAPABILITIES': 'compute,utility', + 'NVIDIA_VISIBLE_DEVICES': 'all' +}