Nsight Systems fails to start the application - full logs and screenshots provided

Hi,

I recently learned about this profiler and am trying to record my first trace with it. I would be very grateful for some advice on how to fix the issue that I am experiencing.

I set up the project in the GUI but when I try to start the application, the profiler starts the application but then almost immediately after that reports an error and does not proceed with the profiling session. The application that it had started, however, carries on running successfully.

I tried several different executables but I always get the same error.

The rest of this post contains the screenshots of my NVIDIA Nsight Systems project configuration and the logs resulting from an unsuccessful run of the project.

I am using Windows 11: version 22H2 OS build 22621.2428.
NVIDIA Nsight Systems: version 2023.3.1.92-233133147223v0 Windows-x64.
GPU: NVIDIA GeForce RTX 4070 Ti
Driver: version 545.84, type DCH

Screenshot of NVIDIA Nsight Systems “About” window:

Screenshot of NVIDIA Nsight Systems profiling target selection settings:

Screenshot of NVIDIA Nsight Systems project settings:

Screenshot of NVIDIA Nsight Systems project run attempt resulting in error:

Clicking Show details in the GUI reveals the following log:

DeviceId: "Local"
EventTypes {
}
HowToStart: Immediate
HowToStop: Manual
DeviceType: Windows
DeviceDisplayName: "neon"
WindowsPerfOptions {
  retainEtwFiles: true
  SymbolSearchVerboseLog: false
  AutomaticallyGenerateReportFileNames: true
}
Processes {
  HowToAttach: LaunchAnother
  Command: "C:\\Steam\\steamapps\\common\\Starfield\\Starfield.exe"
  WorkingDirectory: "C:\\Steam\\steamapps\\common\\Starfield"
  UserName: "ollie"
}
ShowBacktrace: true
IncludeChildren: true
HotkeyEnabled: true
HotkeyValue: 123
GpuMetricsOptions {
  SamplingFrequency: 10000
  Gpus {
    Id: 0
    MetricSetIndex: 0
  }
}
SymbolResolutionOptions {
  ResolveSymbols: false
}

In my futile attempt to resolve this, I followed the troubleshooting advice from the User Guide and enabled logging on the host by copying the file nvlog.config.template from C:\Program Files\NVIDIA Corporation\Nsight Systems 2023.3.1\host-windows-x64 into the application working directory under the name of nvlog.config.

Now I have the nsys-ui.log file in the application working directory as well:

I19:12:52:515|Injection| 9504|WindowsModuleInit.cpp:658[DllMain]: Attaching process
I19:12:52:515|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:515|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:515|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:515|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Program Files\NVIDIA Corporation\Nsight Systems 2023.3.1\target-windows-x64\config.ini
I19:12:52:515|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:515|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
E19:12:52:516|Injection| 9504|VulkanEventCollector.cpp:94[VulkanEventCollector::VulkanEventCollector]: Vulkan event collector created without Vulkan or Vulkan SC trace
I19:12:52:516|Injection| 9504|Init.cpp:1354[InitializeInjectionCommon]: UseAgentAPI = 1

I19:12:52:516|Injection| 9504|Manager.cpp:211[Manager::Initialize]: Initialize::start.
I19:12:52:516|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Program Files\NVIDIA Corporation\Nsight Systems 2023.3.1\target-windows-x64\config.ini
I19:12:52:516|Injection| 9504|TimeDurationConverter.cpp:91[Impl::GetNsToTicksMultiplier]: Waiting to improve time duration conversion accuracy
I19:12:52:537|quadd_common_core| 9504|AsyncProcessorHolder.h:29[AsyncProcessor>::AsyncProcessorHolder]: AsyncProcessorHolder[0000000000687650]: 2 AsyncProcessors
I19:12:52:537|quadd_common_core| 9504|AsyncProcessor.cpp:18[AsyncProcessor::AsyncProcessor]: 1TaskRunner@AsyncProcessor[00000000005DE470] is creating.
I19:12:52:537|quadd_common_core| 9504|AsyncProcessor.cpp:62[AsyncProcessor::AsyncProcessor]: 1TaskRunner@AsyncProcessor[00000000005DE470] created.
I19:12:52:537|quadd_common_core| 9504|AsyncProcessor.cpp:18[AsyncProcessor::AsyncProcessor]: 2CommsProcessor@AsyncProcessor[00000000005DD1C0] is creating.
I19:12:52:537|quadd_common_core| 9504|AsyncProcessor.cpp:62[AsyncProcessor::AsyncProcessor]: 2CommsProcessor@AsyncProcessor[00000000005DD1C0] created.
I19:12:52:537|Injection| 2860|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:537|quadd_agent_api| 9504|LocalAgentAPI.cpp:297[Agent::CreateLocalAgentAPI]: Create local AgentAPI.
I19:12:52:537|Injection|11864|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:537|quadd_common_core| 2860|AsyncProcessor.cpp:33[<lambda_153952e7d03a92b4b0cab9eec1d80350>::operator ()]: Thread[2860] started servicing 1TaskRunner@AsyncProcessor.
I19:12:52:537|quadd_common_core|11864|AsyncProcessor.cpp:33[<lambda_153952e7d03a92b4b0cab9eec1d80350>::operator ()]: Thread[11864] started servicing 2CommsProcessor@AsyncProcessor.
I19:12:52:537|processinjection| 2860|ProcessInjection.cpp:466[Detour_RaiseException]: Caught SetThreadName exception
I19:12:52:537|processinjection|11864|ProcessInjection.cpp:466[Detour_RaiseException]: Caught SetThreadName exception
I19:12:52:537|processinjection| 2860|ProcessInjection.cpp:467[Detour_RaiseException]:     Thread Name = *1TaskRunner, Thread Id = 2860
I19:12:52:537|processinjection|11864|ProcessInjection.cpp:467[Detour_RaiseException]:     Thread Name = *2CommsProcessor, Thread Id = 11864
I19:12:52:537|processinjection| 2860|ProcessInjection.cpp:422[Detour_SetThreadDescription]: Caught SetThreadDescription. ThreadId = 2860, Description = *1TaskRunner
I19:12:52:537|processinjection|11864|ProcessInjection.cpp:422[Detour_SetThreadDescription]: Caught SetThreadDescription. ThreadId = 11864, Description = *2CommsProcessor
I19:12:52:537|quadd_agent_api|11864|LocalSession.cpp:107[LocalSession::Connect]: Connect to agent tcp://127.0.0.1:52293
I19:12:52:537|quadd_pbcomm_tcp|11864|Communicator.cpp:536[CommunicatorCreator::CommunicatorCreator]: CommunicatorCreator[00000000005E83A0] created.
I19:12:52:537|quadd_pbcomm_proxy|11864|ClientProxy.cpp:63[ClientProxy::ClientProxy]: ClientProxy[000000000243BD00] created.
I19:12:52:538|quadd_pbcomm_proxy|11864|ClientProxy.cpp:146[ClientProxy::HandleStart]: ClientProxy[000000000243BD00] is starting.
I19:12:52:538|Injection|13724|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:296[Connector::Connector]: Connector[00000000005E0A40] created.
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:302[Connector::Start]: Connector[00000000005E0A40] is connecting to 127.0.0.1:52293 .
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:312[Connector::Start]: Connector[00000000005E0A40] set timeout 60 seconds.
I19:12:52:538|Injection| 8072|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:358[Connector::HandleConnect]: Connector[00000000005E0A40] connected.
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:361[Connector::HandleConnect]: Connector[00000000005E0A40]: reading BuildId.
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:443[Connector::HandleRead]: Connector[00000000005E0A40]: BuildId checked: 233133147223v0
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:71[Communicator::Communicator]: Communicator[0000000002448420] created.
I19:12:52:538|quadd_pbcomm_tcp|11864|Communicator.cpp:284[Connector::~Connector]: Connector[00000000005E0A40] destroyed.
I19:12:52:538|quadd_pbcomm_proxy|11864|ClientProxy.cpp:164[ClientProxy::HandleConnect]: ClientProxy[000000000243BD00] connected to the server.
I19:12:52:538|quadd_agent_api|11864|LocalSession.cpp:134[<lambda_0bbd4be0f931bcc60f925358919ca1a8>::operator ()]: Connect to agent succeeded.
I19:12:52:538|Injection| 9504|Manager.cpp:256[Manager::Initialize]: Injection library attached to session successfully.
I19:12:52:538|Injection| 9504|EventHandlerImpl.cpp:766[EventHandlerImpl::RegisterStartStopAnalysisHandler]: Registered NVTX start/stop handler (000000000243CC80)
I19:12:52:539|Injection|12268|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:539|Injection| 9504|AppTraceController.cpp:33[AppTraceController::AppTraceController]: AppTraceController[000000000244A720,5228]: 
I19:12:52:539|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:539|Injection| 9504|Init.cpp:931[RegisterCallbackBeforeExitProcess]: GetExportTable loaded OK
I19:12:52:541|Injection|11864|Init.cpp:1263[`anonymous-namespace'::HandleNotification]: Injection library received notification: config {
  params {
    AnalysisOptions {
      [QuadDCommon.AnalysisService.ProcessInfoExt] {
      }
      [QuadDCommon.AnalysisService.FilesOptionsExt] {
        StdOutErrRedirect: true
      }
      [QuadDCommon.AnalysisService.WindowsPerfOptionsExt] {
        CollectBacktrace: true
        retainEtwFiles: true
        SymbolSearchVerboseLog: false
        AutomaticallyGenerateReportFileNames: true
      }
      [QuadDCommon.AnalysisService.BlockedThreadStatesOptionsExt] {
      }
      [QuadDCommon.AnalysisService.TraceOptionsExt] {
        TraceChildProcesses: true
        HowToStart: Immediate
      }
      [QuadDCommon.AnalysisService.HotKeyOptionsExt] {
        Value: 123
      }
      [QuadDCommon.AnalysisService.KillAppOnShutdownOptionsExt] {
        SignalNumber: 1
      }
      [QuadDCommon.AnalysisService.GpuMetricsOptionsExt] {
        SamplingFrequency: 10000
        Gpus {
          Id: 0
          MetricSetIndex: 0
        }
      }
      [QuadDCommon.AnalysisService.SymbolResolutionOptionsExt] {
        ResolveSymbols: false
      }
    }
    HowToStart: Immediate
    HowToStop: Manual
    DeviceId: "Local"
    DeviceDisplayName: "neon"
    HotkeyEnabled: true
    HotkeyValue: 123
    ProfilingSessionUuid: "03aabb65-f364-4784-8f9e-77e961af1e26"
    ProfilingSessionId: "105228"
  }
  cli_command_line: "Started from NSys GUI"
  working_directory: "C:/Users/ollie/Documents/NVIDIA Nsight Systems/Projects/Project 1"
  capture_range {
    trigger_flags: 8
    end_action: 2
  }
  output_path: "C:/Users/ollie/Documents/NVIDIA Nsight Systems/Projects/Project 1\\report%n"
}

I19:12:52:541|Injection|11864|ProfilerApiImpl.cpp:465[RpcImpl::Notify]: Capture range triggers = 8, capture range end action = 2, flush on cudaProfilerStop = false
I19:12:52:542|Injection|11864|Init.cpp:1263[`anonymous-namespace'::HandleNotification]: Injection library received notification: current_state: 13

I19:12:52:542|Injection|11864|ProfilerApiImpl.cpp:483[RpcImpl::Notify]: Agent state = StartRange
I19:12:52:542|Injection| 9504|Init.cpp:1200[IsRecordingFromSessionState]: Session state = StartRange
I19:12:52:543|Injection| 2860|Init.cpp:491[NameServiceThread]: Naming service thread 2860 as [NSys].
I19:12:52:543|Injection|11864|Init.cpp:491[NameServiceThread]: Naming service thread 11864 as [NSys Comms].
I19:12:52:543|Injection| 9504|Init.cpp:1514[InitializeInjectionCommon]: Injection Common Init OK
I19:12:52:543|Injection| 9504|ThreadNameHandler.cpp:54[ThreadNameHandler::QueueThreadNameEvent]: Recording thread name: tid = 2860, name = [NSys]
I19:12:52:543|Injection| 9504|ThreadNameHandler.cpp:54[ThreadNameHandler::QueueThreadNameEvent]: Recording thread name: tid = 11864, name = [NSys Comms]
I19:12:52:543|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:543|Injection| 9504|Win32Interceptor.cpp:77[Win32Interceptor::Win32Interceptor]: Win32InjectionManager init
I19:12:52:543|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:543|processinjection| 2860|ProcessInjection.cpp:466[Detour_RaiseException]: Caught SetThreadName exception
I19:12:52:543|processinjection| 2860|ProcessInjection.cpp:467[Detour_RaiseException]:     Thread Name = [NSys], Thread Id = 2860
I19:12:52:543|processinjection| 2860|ProcessInjection.cpp:422[Detour_SetThreadDescription]: Caught SetThreadDescription. ThreadId = 2860, Description = [NSys]
I19:12:52:543|processinjection|11864|ProcessInjection.cpp:466[Detour_RaiseException]: Caught SetThreadName exception
I19:12:52:543|processinjection|11864|ProcessInjection.cpp:467[Detour_RaiseException]:     Thread Name = [NSys Comms], Thread Id = 11864
I19:12:52:543|processinjection|11864|ProcessInjection.cpp:422[Detour_SetThreadDescription]: Caught SetThreadDescription. ThreadId = 11864, Description = [NSys Comms]
I19:12:52:543|Injection| 9504|EventHandlerImpl.cpp:766[EventHandlerImpl::RegisterStartStopAnalysisHandler]: Registered Win32 Interceptor start/stop handler (0000000002488CD0)
I19:12:52:543|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Users\ollie\AppData\Local\Temp\nvidia\nsight_systems\injection_files/injection_config_9240bac9
I19:12:52:544|Injection| 9504|KeyboardInterceptor.cpp:46[KeyboardInterceptor::Init]: KeyboardInjectionManager init
I19:12:52:544|quadd_common_core| 9504|StdOutErrManager.cpp:541[ShouldRedirectStreams]: Using C:\Program Files\NVIDIA Corporation\Nsight Systems 2023.3.1\target-windows-x64\config.ini file as main config file
I19:12:52:544|quadd_common_core| 9504|Config.cpp:87[Impl::InternalReset]: Loaded config file: C:\Program Files\NVIDIA Corporation\Nsight Systems 2023.3.1\target-windows-x64\config.ini
E19:12:52:544|quadd_common_core| 9504|StdOutErrManager.cpp:353[StdOutErrManager::StdOutErrManager]: Failed to duplicate stdout handle error: The handle is invalid
E19:12:52:544|quadd_common_core| 9504|StdOutErrManager.cpp:365[StdOutErrManager::StdOutErrManager]: Failed to duplicate stderr handle error: The handle is invalid
I19:12:52:546|quadd_common_core| 9504|StdOutErrManager.cpp:566[RunStdStreamsRedirectionPumpThreads]: EnableStdOutErrCapture = 1
I19:12:52:546|Injection| 5252|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:546|Injection| 5252|Init.cpp:491[NameServiceThread]: Naming service thread 5252 as [NSys stream redirect].
I19:12:52:546|Injection| 5424|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:546|Injection| 5424|Init.cpp:491[NameServiceThread]: Naming service thread 5424 as [NSys stream redirect].
I19:12:52:805|Injection| 4484|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:809|vwsm| 9504|Win32Windows.cpp:847[Win32Windows::DoCreateWindowEx]: Added window proc to data hash: hwnd=0x00000000007D0658, wndProc=0x00007FFCB60FBC30, key=2858, index=2858
I19:12:52:809|wsm| 9504|Win32Windows.cpp:1078[Win32Windows::SignalLifetimeEvent]: Signaling window lifetime event: HWND=0x00000000007D0658, event=0
I19:12:52:816|Injection|11352|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:817|Injection| 7016|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:822|Injection| 4164|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:822|Injection|13060|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:823|Injection|11444|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:823|vwsm| 9504|Win32Windows.cpp:956[Win32Windows::DoSetWindowLongPtr]: Setting window longptr: hwnd=0x00000000007D0658, nIndex=-4, dwNewLong=0x7ffcb606df90
I19:12:52:823|vwsm| 9504|Win32Windows.cpp:1064[Win32Windows::WriteWindowProc]: Added window proc to data hash: hwnd=0x00000000007D0658, wndProc=0x00007FFCB606DF90, previousWndProc=0x00007FFCB60FBC30, key=2858, index=2858
I19:12:52:823|Injection| 3364|WindowsModuleInit.cpp:679[DllMain]: Attaching thread
I19:12:52:864|wsm| 9504|Win32Windows.cpp:1078[Win32Windows::SignalLifetimeEvent]: Signaling window lifetime event: HWND=0x00000000007D0658, event=1
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:1027[Win32Windows::ReadWindowProc]: Reading window proc from data hash: hwnd=0x00000000007D0658, wndProc=0x00007FFCB606DF90, key=2858, index=2858
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:1265[Win32Windows::WndProc]: Calling window proc 0x00007FFCB606DF90, hwnd=0x00000000007D0658
I19:12:52:864|wsm| 9504|Win32Windows.cpp:1078[Win32Windows::SignalLifetimeEvent]: Signaling window lifetime event: HWND=0x00000000007D0658, event=2
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:1027[Win32Windows::ReadWindowProc]: Reading window proc from data hash: hwnd=0x00000000007D0658, wndProc=0x00007FFCB606DF90, key=2858, index=2858
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:1265[Win32Windows::WndProc]: Calling window proc 0x00007FFCB606DF90, hwnd=0x00000000007D0658
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:1027[Win32Windows::ReadWindowProc]: Reading window proc from data hash: hwnd=0x00000000007D0658, wndProc=0x00007FFCB606DF90, key=2858, index=2858
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:1265[Win32Windows::WndProc]: Calling window proc 0x00007FFCB606DF90, hwnd=0x00000000007D0658
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:584[Win32Windows::Detour_DestroyWindowImpl]: Removing window from data hash: hwnd=0x00000000007D0658
I19:12:52:864|vwsm| 9504|Win32Windows.cpp:591[Win32Windows::Detour_DestroyWindowImpl]: Removed window from data hash: wndProc=0x00007FFCB606DF90, key=2858, index=2858
I19:12:52:864|wsm| 9504|Win32Windows.cpp:1078[Win32Windows::SignalLifetimeEvent]: Signaling window lifetime event: HWND=0x00000000007D0658, event=3
I19:12:52:864|wsm| 9504|Win32Windows.cpp:772[Win32Windows::Detour_TerminateProcessImpl]: Received ExitProcess call with 53
E19:12:52:872|processinjection|11892|ProcessInjection.cpp:2047[InitCrashHandling]: Failed to create process (arguments=C:\Program Files\NVIDIA Corporation\Nsight Systems 2023.3.1\target-windows-x64\CrashReporter.exe \\.\pipe\AgoraCrashPipe-90d45e8e-5c84-4ae5-bb08-75c93b218c07 "NVIDIA Nsight Systems" "QuadD" 0.0 --show-aftermath-link --injected-process steam, LastError=2)

Since I am neither a GPU nor a Windows developer, at this point I could use some help with how to proceed, please. I can collect and post additional logs and screenshots, if need be - just let me know what you need. Thank you!

I think your problem is that you are running into the anti-cheat codes (in Steam).

  1. Does it work on non-steam codes/non games code? You can run on something as simple as opening a new command shell, although you won’t see anythign interesting in the results.

  2. Have you tried the --injection-use-detours=false option?By default, Nsys uses detours for injection. If false, process injection will be performed by windows hooks which allows to bypass anti-cheat software. (Warning: the name of this option is likely to change in future versions.)

Thank you for your prompt reply! I just made partial progress following your advice:

I just tested it with… C:\Windows\System32\notepad.exe and it worked! So the issue is likely to be with Steam.

I’d love to try that but am not sure how to specify the command line options to the profiler from the Windows GUI?

From what I see in Windows Task Manager, NVIDIA Nsight Systems runs as a whole bunch (group?) of processes so I am not sure which one of them needs this option and how to facilitate that. Any advice is very welcome!

Information about the CLI can be found at User Guide :: Nsight Systems Documentation (that’s a direct link, the forum software just renders it as the top level directory).

Unfortunately I don’t see a GUI option for --injection-use-detours=false. But I work on the Linux side mostly. @dofek, is there a GUI option for this?

As far as using the CLI, it look like all you have going is backtraces and GPU metrics. So something like:

nsys profile --trace=none --gpu-metrics-device=all [application name]

should work for you. You can find the “nsys” command line tool in your installation/host* directory